-
Notifications
You must be signed in to change notification settings - Fork 10
/
Gruntfile.js
54 lines (46 loc) · 1.15 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) {
"use strict";
grunt.initConfig({
testem: {
options : {
launch_in_ci : ['Chrome'],
output: {
coverage: 'tmp/coverage/from_browsers/'
},
routes: {
"/lib": "../lib",
"/src": "instrumented"
}
},
all : {
files : {
'tmp/result.tap': ['test/index.html']
}
}
},
clean: {
tests: ['tmp']
},
// This section is to instrument files from grunt
shell: {
instrument: {
command: "istanbul instrument --output instrumented src"
},
report: {
command: "istanbul report --root tmp/coverage/from_browsers --dir tmp/coverage lcov"
},
options: {
stdout: true,
failOnError: true
}
}
});
// In real life replace this line:
grunt.loadTasks('../../tasks');
// with
// grunt.loadNpmTasks('grunt-testem');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('test', ['clean', 'shell:instrument', 'testem', 'shell:report']);
grunt.registerTask('default', ['test']);
};