Skip to content

Commit c2e2228

Browse files
committed
Updated Gruntfile: "grunt dev" will run jasmine tests on js change (same as grunt watch), "grunt" will run tests and generate release, "grunt test" will only run jasmine tests.
1 parent 6b6fa14 commit c2e2228

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Gruntfile.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports = function(grunt) {
6464
// For jasmine usage, see: http://pivotal.github.io/jasmine/
6565
// For grunt's jasmine, see: https://github.com/gruntjs/grunt-contrib-jasmine
6666
jasmine: {
67-
customTemplate: {
67+
wsm: {
6868
src: 'src/**/*.js',
6969
options: {
7070
specs: 'spec/*Spec.js',
@@ -79,7 +79,7 @@ module.exports = function(grunt) {
7979
tasks: ['jshint:gruntfile']
8080
},
8181
test: {
82-
files: '<%= concat.dist.src %>',
82+
files: ['<%= jasmine.wsm.src %>', '<%= jasmine.wsm.options.specs %>', '<%= jasmine.wsm.options.helpers%>'],
8383
tasks: ['test']
8484
}
8585
// lib_test: {
@@ -96,14 +96,17 @@ module.exports = function(grunt) {
9696
grunt.loadNpmTasks('grunt-contrib-watch');
9797
grunt.loadNpmTasks('grunt-contrib-jasmine');
9898

99-
// Default task.
100-
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
99+
// Default task (grunt).
100+
grunt.registerTask('default', ['jasmine', 'jshint', 'concat', 'uglify']);
101101

102102
grunt.registerTask('debug', function() {
103103
grunt.log.write(grunt.file.readJSON('package.json').name);
104104
});
105105

106-
// Distribute
107-
grunt.registerTask('test', ['jasmine', 'concat', 'uglify']);
106+
// (grunt dev)
107+
grunt.registerTask('dev', ['watch']);
108+
109+
// (grunt test)
110+
grunt.registerTask('test', ['jasmine']);
108111

109112
};

0 commit comments

Comments
 (0)