grunt-contrib-watch/Gruntfile.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2012-10-09 13:37:24 +08:00
/*
* grunt-contrib-watch
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt-contrib-watch/blob/master/LICENSE-MIT
*/
2012-10-10 06:10:58 +08:00
'use strict';
2012-10-09 13:37:24 +08:00
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
2012-10-10 06:10:58 +08:00
all: [
'Gruntfile.js',
'tasks/*.js',
'<%= nodeunit.tests %>'
],
2012-10-09 13:37:24 +08:00
options: {
2012-10-10 06:10:58 +08:00
jshintrc: '.jshintrc'
2012-10-09 13:37:24 +08:00
}
},
// Watch
watch: {
files: ['<%= jshint.all %>'],
tasks: ['jshint', 'nodeunit']
2012-10-09 13:37:24 +08:00
},
// Unit tests.
nodeunit: {
2012-10-10 06:10:58 +08:00
tests: ['test/**/*_test.js']
2012-10-09 13:37:24 +08:00
}
2012-10-10 06:10:58 +08:00
2012-10-09 13:37:24 +08:00
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
2012-10-10 06:10:58 +08:00
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-internal');
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
2012-10-09 13:37:24 +08:00
grunt.registerTask('test', ['nodeunit']);
// By default, lint and run all tests.
2012-10-10 06:10:58 +08:00
grunt.registerTask('default', ['jshint', 'test']);
2012-10-09 13:37:24 +08:00
};