Include grunt-jasmine-task to run specs as part of the build process.
Showing
2 changed files
with
8 additions
and
2 deletions
... | @@ -8,6 +8,9 @@ module.exports = function(grunt) { | ... | @@ -8,6 +8,9 @@ module.exports = function(grunt) { |
8 | '// author: <%= pkg.author %>\n' + | 8 | '// author: <%= pkg.author %>\n' + |
9 | '// license: <%= pkg.licenses[0].type %>' | 9 | '// license: <%= pkg.licenses[0].type %>' |
10 | }, | 10 | }, |
11 | jasmine: { | ||
12 | all: ['spec/index.html'] | ||
13 | }, | ||
11 | lint: { | 14 | lint: { |
12 | files: ['grunt.js', 'lib/**/*.js', 'spec/**/*.js'] | 15 | files: ['grunt.js', 'lib/**/*.js', 'spec/**/*.js'] |
13 | }, | 16 | }, |
... | @@ -19,11 +22,11 @@ module.exports = function(grunt) { | ... | @@ -19,11 +22,11 @@ module.exports = function(grunt) { |
19 | }, | 22 | }, |
20 | watch: { | 23 | watch: { |
21 | files: 'src/rivets.coffee', | 24 | files: 'src/rivets.coffee', |
22 | tasks: 'build' | 25 | tasks: 'build spec' |
23 | }, | 26 | }, |
24 | }); | 27 | }); |
25 | 28 | ||
26 | grunt.registerTask('default', 'watch'); | 29 | grunt.loadNpmTasks('grunt-jasmine-task'); |
27 | 30 | ||
28 | grunt.registerTask('compile', 'Compiles CoffeeScript source into JavaScript.', function(){ | 31 | grunt.registerTask('compile', 'Compiles CoffeeScript source into JavaScript.', function(){ |
29 | var coffee = require('coffee-script'); | 32 | var coffee = require('coffee-script'); |
... | @@ -32,5 +35,7 @@ module.exports = function(grunt) { | ... | @@ -32,5 +35,7 @@ module.exports = function(grunt) { |
32 | if (js) grunt.file.write('lib/rivets.js', banner + js); | 35 | if (js) grunt.file.write('lib/rivets.js', banner + js); |
33 | }); | 36 | }); |
34 | 37 | ||
38 | grunt.registerTask('default', 'watch'); | ||
39 | grunt.registerTask('spec', 'jasmine'); | ||
35 | grunt.registerTask('build', 'compile min'); | 40 | grunt.registerTask('build', 'compile min'); |
36 | }; | 41 | }; | ... | ... |
-
Please register or sign in to post a comment