Slide 15
Slide 15 text
module.exports = function(grunt) {
grunt.initConfig({
watch: {
scripts: {
files: [‘helloworld.js'],
tasks: ['specs']
}
},
jshint: {
all: {
options: {
undef: true,
eqeqeq: true
},
files: {
src: 'helloworld.js'
}
}
},
jasmine: {
all: {
src: 'helloworld.js',
options: {
specs: 'helloworld.spec.js',
outfile: 'specs.html',
keepRunner: true
}
}
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.registerTask('specs', ['jshint', 'jasmine:all']);
grunt.registerTask('default', ['specs']);
grunt.registerTask('dev', ['default', 'watch']);
};
Example Gruntfile.js