-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
50 lines (45 loc) · 1.51 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
module.exports = function(grunt){
grunt.initConfig({
mocha_istanbul: {
coverage: {
src: 'test', // a folder works nicely
options: {
reportFormats: ['cobertura','lcovonly', 'html' ]
}
},
jenkins: {
src: ['test/**/*.js'],
options: {
reporter: 'XUnit',
output: 'build/test-result.xml'
}
},
coveralls: {
src: 'test', // multiple folders also works
options: {
coverage:true,
root: './lib', // define where the cover task should consider the root of libraries that are covered by tests
reportFormats: ['lcovonly']
}
}
},
istanbul_check_coverage: {
default: {
options: {
coverageFolder: 'coverage*', // will check both coverage folders and merge the coverage results
check: {
lines: 80,
statements: 80
}
}
}
}
});
grunt.event.on('coverage', function(lcovFileContents, done){
// Check below
done();
});
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.registerTask('coveralls', ['mocha_istanbul:coveralls']);
grunt.registerTask('coverage', ['mocha_istanbul:coverage']);
}