Skip to content

Instantly share code, notes, and snippets.

@ericdouglas
Created February 5, 2014 21:04
Show Gist options
  • Select an option

  • Save ericdouglas/8833048 to your computer and use it in GitHub Desktop.

Select an option

Save ericdouglas/8833048 to your computer and use it in GitHub Desktop.
Simple test with jasmine-node

jasmine-node spec --autotest --watch .

Now jasmine-node listens to changes on the whole project, but only look for specs in the spec folder.

exports.multiply = function ( multiplier1, multiplier2 ) {
// return 6;
// return 15;
return multiplier1 * multiplier2;
};
var calculator = require('../calculator');
describe('multiplication', function () {
it('should multiply 2 and 3', function () {
var product = calculator.multiply( 2, 3 );
expect( product ).toBe( 6 );
});
it('should multiply 3 and 5', function () {
var product = calculator.multiply( 3, 5 );
expect( product ).toBe( 15 );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment