npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

noisy-jasmine

v1.0.2

Published

Tools to make Jasmine testing in Node a little easier

Downloads

4

Readme

noisy-jasmine

Implements jasmine pre-configurations and test runner tools.

Codeship Status for noisygerman/noisy-node-dev-tools

run-tests.js

Executing ./run-tests.js will:

  1. trigger es-linting of the project an print out the results
  2. execute all tests, regardless if errors where detectd during linting.

While I very much appreciate tools like eslint, I usually want to see if my code execute correctly first and have the choice to defer fixing linting issues. Using ./run-tests.js, we get a report on issues, but unlike "pretest": "eslint .", the tests will still execute.

tdd

./run-tests.js supports a continuous run mode. In this mode, the test runner executes, then watches for file changes in the projects spec, lib and server folders.

To run the tests in continuous run or tdd mode, run node_modules/noisy-node-dev-tools/run-tests.js continuously.

Less linting, more testing

You can skip linting in ./run-tests.js by setting the without-linting flag. With that flag set, the script will only execute the test runner.

Note: Currently only the first command line argument is observed, so you cannot run without_linting and continuously at the same time.

package.json

{
  "scripts": {
    "test":         "node node_modules/noisy-node-dev-tools/run-tests.js",
    "test-no-lint": "node node_modules/noisy-node-dev-tools/run-tests.js without-linting",
    "tdd":          "node --inspect node_modules/noisy-node-dev-tools/run-tests.js continuously"
}

With the above configuration, you can execute single test runs via npm test and tdd continuous runs via npm run tdd.

The --inspect flag is optional of course. it simply allows you to connect a debugger while running your tests.

test-util/generate-uit-path.js

test-util/generate-uit-path.js can be used in spec files to resolve paths to uit source-files, if those spec files:

  • end in -spec.js. (Spec.js|spec.js) are currently not supported
  • are located in a directory that follows the same structure as the repo root.

Example:

project-root
├── spec
│   └── test-util
│       └── generate-uit-path-spec.js
└── test-util
    └── generate-uit-path-spec.js

The spec folder, which contains all Jasmine test files, has the same folder structure as project-root.

I.e. the spec file is located at test-util/generate-ui-path-spec.js with its root ar project-root/spec, while the uit file is located at 'test-util/generate-ui-path.js', but directly under project-root.

// file: ./spec/lib/generate-uit-path-spec

describe( 'The generateToUITPath function', ()=>{

  it( 'should resolve the path from its own test file to its own script',()=>{

    const pathToUnitInTest
      = '../../lib/generate-uit-path';

    const generateUITPath
      = require( pathToUnitInTest );

    expect( generateUITPath( __filename ) )
      .toEqual( pathToUnitInTest );

  } );

} );