JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11680
  • Score
    100M100P100Q132915F

Super simple wrapper around Jasmine for Node

Package Exports

  • minijasminenode

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (minijasminenode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

minijasminenode

Based on Jasmine-Node, but minus the fancy stuff. This node.js module makes the wonderful Pivotal Lab's jasmine (http://github.com/pivotal/jasmine) spec framework available in node.js.

features

MiniJasmineNode exports a library which

  • places Jasmine in Node's global namespace, similar to how it's run in a browser
  • adds asynchronous testing with done().
  • adds result reporters for the terminal.
  • adds the ability to load tests from file.

The module also contains a command line wrapper that can be run with

./bin/minijl specDir/mySpec1.js specDir/mySpec2.js

For more info on the command line wrapper

./bin/minijl --help

usage

var miniJasmineLib = require('minijasminenode');
// At this point, jasmine is available in the global node context

// Add your tests by filename.
miniJasmineLib.addSpecs('myTestFolder/mySpec.js');

// If you'd like to add a custom Jasmine reporter, you can do so. Tests will
// be automatically reported to the terminal.
miniJasmineLib.addReporter(myCustomReporter);

// Run those tests!
miniJasmineLib.executeSpecs();

You can also pass an options object into executeSpecs

var miniJasmineLib = require('minijasminenode');

var options = {
  // An array of filenames, relative to current dir. These will be
  // executed, as well as any tests added with addSpecs()
  specs: ['specDir/mySpec1.js', 'specDir/mySpec2.js'],
  // A function to call on completion.
  // function(runner, log)
  done: function(runner, log) { util.prints('done!'); },
  // If true, display spec names.
  isVerbose: false,
  // If true, print colors to the terminal.
  showColors: true,
  // If true, include stack traces in failures.
  includeStackTrace: true
};
miniJasmineLib.executeSpecs(options);

jasmine

Version 1.3.1 of Jasmine is currently included with node-jasmine.

to run the tests

./specs.sh

This will run passing tests as well as show examples of how failures look. To run only passing tests, use npm test or ./bin/minijn spec/*_spec.js