node-query/Gruntfile.js

64 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-10-20 16:56:45 -04:00
module.exports = function(grunt) {
'use strict';
2014-10-24 10:30:54 -04:00
var tests = 'tests/**/*_test.js';
var src = 'lib/**/*.js';
var reportDir = 'coverage';
2014-10-20 16:56:45 -04:00
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
2014-10-24 10:30:54 -04:00
clean: [ 'build' ],
2014-10-20 16:56:45 -04:00
jsdoc: {
dist: {
2014-10-23 10:53:16 -04:00
src: ['lib/*.js', 'README.md'],
2014-10-20 16:56:45 -04:00
options: {
2014-10-22 10:13:08 -04:00
template: 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template',
configure: 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template/jsdoc.conf.json',
2014-10-20 16:56:45 -04:00
destination: 'docs'
}
}
},
nodeunit: {
2014-10-24 10:30:54 -04:00
all: [tests],
2014-10-23 10:53:16 -04:00
options: {
reporter: 'verbose'
}
2014-10-24 10:30:54 -04:00
},
watch: {
files: [src, tests],
tasks: 'default'
},
instrument: {
files: src,
options: {
lazy: true,
basePath : 'build/instrument/'
}
},
storeCoverage : {
options : {
dir: reportDir
}
},
makeReport: {
src: 'build/reports/**/*.json',
options: {
type: ['lcov', 'html'],
dir: reportDir,
print: 'detail'
}
2014-10-20 16:56:45 -04:00
}
});
grunt.loadNpmTasks('grunt-jsdoc');
2014-10-24 10:30:54 -04:00
grunt.loadNpmTasks('grunt-contrib-clean');
2014-10-20 16:56:45 -04:00
grunt.loadNpmTasks('grunt-contrib-nodeunit');
2014-10-24 10:30:54 -04:00
grunt.loadNpmTasks('grunt-istanbul');
2014-10-20 16:56:45 -04:00
grunt.registerTask('default', ['nodeunit','jsdoc']);
grunt.registerTask('tests', 'nodeunit');
2014-10-22 10:13:08 -04:00
grunt.registerTask('docs', 'jsdoc');
2014-10-24 10:30:54 -04:00
grunt.registerTask('cover', ['clean', 'instrument', 'tests', 'storeCoverage', 'makeReport']);
2014-10-20 16:56:45 -04:00
};