run-jasmine

1.0.0 • Public • Published

run-jasmine Build Status

Prepares and executes jasmine in the current environment, only if jasmine is not defined. This is useful for having self-executing test files.

When your IDE is configured to execute .js files through node (like with a Sublime build system), this allows you quickly run a test without having to configure anything.

Usage

  1. Add this module and jasmine as dependencies:
$ npm install --save-dev jasmine run-jasmine
  1. Then, in your test files, add:
require('run-jasmine')();

Example

Say you have test/verify-test.js, and it looks like this:

require('run-jasmine')();

describe('verify-test', () => {
  it('works', () => {
    expect(true).toBe(true);
  });
});

By calling run-jasmine before the specs are defined, you can run this test in two ways:

  1. Through jasmine, with ./node_modules/.bin/jasmine test/verify-test.js.
  2. Or, by running the script directly, with node test/verify-test.js.

Readme

Keywords

Package Sidebar

Install

npm i run-jasmine

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • zertosh