-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
40 lines (37 loc) · 1.08 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module.exports = function(grunt) {
grunt.initConfig({
simplemocha: {
options: {
globals: ['should'],
timeout: 2000,
ignoreLeaks: false,
ui: 'bdd',
reporter: 'spec'
},
all: {
src: 'test/**/*.js'
}
},
jshint: {
files: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js']
},
blanket: {
options: {},
files: { 'lib-cov/': ['lib/'] }
}
});
grunt.registerTask('run-test-cov', 'run mocha locally', function() {
require('child_process').exec('mocha --require blanket -R html-cov > coverage.html', function(error, stdout, stderr) {
if (error)
throw new Error('error running mocha ' + stderr);
else
console.log('done generating test coverage report: coverage.html');
});
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-blanket');
grunt.registerTask('test-cov', ['run-test-cov']);
grunt.registerTask('test', ['jshint', 'simplemocha']);
grunt.registerTask('default', ['test']);
};