forked from arikon/mocha-istanbul
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathGruntfile.js
57 lines (53 loc) · 1.85 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
55
56
57
module.exports = function (grunt) {
var nodeExec = require.resolve('.bin/babel-node' + (process.platform === 'win32' ? '.cmd' : ''));
grunt.initConfig({
mocha_istanbul: {
target: {
src: 'test/*.test.js',
options: {
//coverageFolder: 'lcov',
coverage: true,
noColors: true,
dryRun: false,
//root: './test',
//root: './tasks',
//print: 'detail',
check: {
lines: 1
},
require: ['test/*1.js'],
excludes: ['test/excluded*.js', '**/other.js'],
mochaOptions: ['--bail', '--debug-brk'],
reporter: 'spec',
reportFormats: ['html','lcovonly']
}
},
babel: {
src: 'test/*.es6.js',
options: {
nodeExec: nodeExec,
reportFormats: ['html'],
istanbulOptions: ['--verbose'],
root: 'es6',
mochaOptions: ['--compilers', 'js:babel-register']
}
},
isparta: {
src: 'test/*.es5.js',
options: {
nodeExec: nodeExec,
reportFormats: ['html'],
istanbulOptions: ['--verbose'],
root: 'es6',
scriptPath: require.resolve('isparta/lib/cli')
}
}
}
});
grunt.event.on('coverage', function (content, done) {
console.log(content.slice(0, 15) + '...');
done();
});
require('./tasks')(grunt);
grunt.registerTask('default', ['mocha_istanbul']);
};