6

Closed

Test Explorer should detect/run Jasmine tests

description

Right now it doesn't detect them. Example code:
// calculator.js 
exports.add = function(a, b) {
    return a + b
};
exports.subtract = function(a, b) {
    return a - b;
};
// calculator.spec.js
var calc = require('./calculator.js');
describe("Calculator Test Suite", function() {
    beforeEach(function() {
        console.log('Runs before each test in suite');
    });
    afterEach(function() {
        console.log('Runs after each test in suite');
    });
    it("Add", function() {
        console.log('Running add test');
        expect(calc.add(4, 8)).toEqual(12);
    });
    it("Subtract", function() {
        console.log('Running subtract test');
        expect(calc.subtract(11, 7)).toEqual(4);
    });
});
Install jasmine:
npm install jasmine-node -g
Run at the command line:
jasmine-node .
If your test files don't have 'spec' in their names, then specify --matchall when invoking jasmine-node.
Closed Jul 21, 2015 at 10:30 PM by mousetraps

comments

huguesv wrote Feb 17, 2014 at 8:09 PM