Make it possible to run node tests from npm/grunt

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-05-16 13:28:48 -04:00 committed by David Humphrey
parent 9c9f4f2478
commit 57640e7bf6
2 changed files with 6 additions and 9 deletions

View File

@ -49,12 +49,9 @@ module.exports = function(grunt) {
}
},
shell: {
mocha: {
test: {
options: {
log: true,
urls: [ 'http://127.0.0.1:9001/tests/index.html' ]
}
command: './node_modules/.bin/mocha --reporter list --no-exit tests/node-runner.js'
}
},
@ -90,13 +87,12 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('develop', ['clean', 'requirejs']);
grunt.registerTask('release', ['develop', 'uglify']);
grunt.registerTask('check', ['jshint']);
grunt.registerTask('test', ['check', 'connect', 'mocha']);
grunt.registerTask('test', ['check', 'shell:mocha']);
grunt.registerTask('default', ['develop']);
};

View File

@ -28,6 +28,7 @@
"grunt-contrib-connect": "~0.1.2",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-jshint": "~0.7.1",
"grunt-shell": "~0.7.0",
"grunt-mocha": "0.4.10",
"requirejs": "~2.1.11",
"mocha": "~1.18.2",