-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
54 lines (50 loc) · 1.53 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mochaTest: {
test: {
options: {},
src: ['test/**/*.js']
}
},
mocha_istanbul: {
coverage: {
src: 'test',
options: {}
},
coveralls: {
src: ['test'], // multiple folders also works
options: {
coverage:true, // this will make the grunt.event.on('coverage') event listener to be triggered
check: {
lines: 0,
statements: 0
},
reportFormats: ['cobertura','lcovonly']
}
}
},
shell: {
deploy: {
command: 'deploy.bat'
}
},
});
// Coveralls support
grunt.event.on('coverage', function(lcov, done){
require('coveralls').handleInput(lcov, function(err){
if (err) {
return done(err);
}
done();
});
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-mocha-istanbul');
// Default task(s).
grunt.registerTask('default', ['mocha_istanbul:coverage']);
grunt.registerTask('coverage', ['mocha_istanbul:coverage']);
grunt.registerTask('coveralls', ['mocha_istanbul:coveralls']);
};