...but that is not fast enough.
Install with:
$ npm install grunt-contrib-jasmine --save-dev
Enable in Gruntfile with:
grunt.loadNpmTasks('grunt-contrib-jasmine');
module.exports = function(grunt) { grunt.initConfig({ jasmine: { src: 'src/**/*.js', options: { specs: 'spec/**/*.js' } } }); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.registerTask('test', ['jasmine']); }
$ grunt test
Running "jasmine:examples" (jasmine) task Testing jasmine specs via phantom ... 3 specs in 0.001s. >> 0 failures Done, without errors.
Install with:
$ npm install grunt-regarde --save-dev
Enable in Gruntfile with:
grunt.loadNpmTasks('grunt-regarde');
module.exports = function(grunt) { grunt.initConfig({ jasmine: {...}, regarde: { tests: { files: ['src/**', 'spec/**'], tasks: ['test'] } }, }); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-regarde'); grunt.registerTask('test', ['jasmine']); grunt.registerTask('test-reload', ['test', 'regarde:tests']); }
$ grunt test-reload --forceWithout --force, grunt will stop running on test failure. --force is required due to an issue with regarde - will keep running tests on failure
Install with:
$ npm install grunt-notify --save-dev
Enable in Gruntfile with:
grunt.loadNpmTasks('grunt-notify');