Reputation: 48476
I'm trying to get started on testing JavaScript on the server-side with Node.JS
I'm using grunt, and grunt-jasmine-node, but I can't get it to run my tests.
It just logs
PS C:\Development\NET\Source\jsn> grunt Running "jasmine_node" task undefined
Finished in 0.001 seconds 0 tests, 0 assertions, 0 failures
Done, without errors.
This is my Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jasmine_node: {
specNameMatcher: 'spec',
projectRoot: '.',
requirejs: false,
forceExit: true,
jUnit: {
report: false,
savePath : "./build/reports/jasmine/",
useDotNotation: true,
consolidate: true
}
}
});
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.registerTask('default', 'jasmine_node');
};
And my file structure is this:
So, what am I doing wrong?
It's like the stub.js
file isn't ever even loaded, because it has a console.log
call in it to test that.
Upvotes: 7
Views: 2548
Reputation: 48476
Either:
.spec.js
Or
specNameMatcher
with matchall: true
Upvotes: 6