grunt-lib-contrib
Version:
Common functionality shared across grunt-contrib tasks.
60 lines (52 loc) • 1.18 kB
JavaScript
/*
* grunt-lib-contrib
* http://gruntjs.com/
*
* Copyright (c) 2012 Tyler Kellen, contributors
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'lib/*.js',
'<%= nodeunit.tests %>'
],
options: {
jshintrc: '.jshintrc'
}
},
test_vars: {
source: 'source/'
},
test_task: {
options: {
param: 'task',
param2: 'task',
template: '<%= test_vars.source %>',
data: {
template: ['<%= test_vars.source %>']
}
},
target: {
options: {
param: 'target'
}
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js']
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
// Whenever the "test" task is run, then test the result.
grunt.registerTask('test', ['nodeunit']);
// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);
};