Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
minijasminenode23
Advanced tools
minijasminenode
with Jasmine version 2.4 under the hood.
Original fork from juliemr with an initial update from xdissent to use Jasmine 2.1 (which has since been updated to 2.4).
Based on Jasmine-Node, but minus the fancy stuff. This node.js module makes Pivotal Lab's Jasmine (http://github.com/pivotal/jasmine) spec framework available in node.js or via the command line.
MiniJasmineNode23 exports a library which
iit
and ddescribe
.xdescribe
, fdescribe
, xit
, fit
, beforeEach
, afterEach
, beforeAll
, afterAll
glob
-ableThe module also contains a command line wrapper.
Get the library with
npm install minijasminenode23
Or, install globally
npm install -g minijasminenode23
If you install globally, you can use minijasminenode directly from the command line
minijasminenode23 mySpecFolder/mySpec.js
See more options
minijasminenode23 --help
// Your test file - mySpecFolder/mySpec.js
describe('foo', function() {
it('should pass', function() {
expect(2 + 2).toEqual(4);
});
});
var miniJasmineLib = require('minijasminenode23');
// 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(options);
You can also pass an options object into executeSpecs
var miniJasmineLib = require('minijasminenode23');
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', 'specDir/**/*.spec.js'],
// A function to call on completion.
// function(passed)
onComplete: function(passed) { console.log('done!'); },
// If true, display suite and spec names.
isVerbose: false,
// If true, print colors to the terminal.
showColors: true,
// If true, include stack traces in failures.
includeStackTrace: true,
// Time to wait in milliseconds before a test automatically fails
defaultTimeoutInterval: 5000
};
miniJasmineLib.executeSpecs(options);
If you want a custom runner instead of the default add it as an option into executeSpecs
var miniJasmineLib = require('minijasminenode23');
var myCustomReporter = require('myCustomReporter');
// At this point, jasmine is available in the global node context.
// Add your tests by filename.
miniJasmineLib.addSpecs('myTestFolder/mySpec.js');
// Run those tests!
miniJasmineLib.executeSpecs({
reporter: myCustomReporter
});
A Grunt
task is included, called jasmine23
:
module.exports = function(grunt) {
grunt.loadNpmTasks('minijasminenode23')
grunt.initConfig({
jasmine23: {
dev: {
// Standard options apply here
options: {
// An array of filenames, relative to current dir. These will be
// executed, as well as any tests added with addSpecs()
specs: ['test/unit/**/*.spec.js'],
// A function to call on completion.
// function(passed)
onComplete: function(passed) { console.log('done!') },
// If true, display suite and spec names.
isVerbose: true,
// If true, print colors to the terminal.
showColors: true,
// If true, include stack traces in failures.
includeStackTrace: true,
// Time to wait in milliseconds before a test automatically fails
defaultTimeoutInterval: 5000
}
}
}
})
grunt.registerTask('default', ['jasmine23:dev'])
./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/minijasminenode23 spec/*_spec.js
FAQs
minijasminenode with Jasmine node 2.3 and grunt support
We found that minijasminenode23 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.