-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
63 lines (54 loc) · 1.22 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
58
59
60
61
62
63
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mochaTest: {
test: {
options: {
reporter: 'spec',
require: 'babel-register'
},
src: ['test/client/**/*.js', 'test/integration/**/*.js', 'test/client/**/*.js']
}
},
// code coverage settings
env: {
coverage: {
APP_DIR_FOR_CODE_COVERAGE: './test/coverage/instrument/app/'
}
},
instrument: {
files: 'client/**/*.js',
options: {
lazy: true,
basePath: 'test/coverage/instrument/'
}
},
storeCoverage: {
options: {
dir: 'test/coverage/reports'
}
},
makeReport: {
src: 'test/coverage/reports/**/*.json',
options: {
type: 'lcov',
dir: 'test/coverage/reports',
print: 'detail'
}
}
});
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-istanbul');
grunt.registerTask('test', [
'mochaTest'
]);
grunt.registerTask('coverage', [
'env:coverage',
'instrument',
'mochaTest',
'storeCoverage',
'makeReport'
]);
}