-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
89 lines (67 loc) · 2.13 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
clean: {
all: ["coverage"]
},
"jasmine_node": {
options:{
forceExit: true
},
instrumented: ["./coverage/instrument/spec"],
specs: ["./spec"]
},
// start - code coverage settings
env: {
coverage: {
APP_DIR_FOR_CODE_COVERAGE: '../coverage/instrument/lib/'
}
},
clean: {
coverage: {
src: ['coverage/']
}
},
instrument: {
files: ['lib/*.js', 'spec/*.js'],
options: {
lazy: true,
basePath: 'coverage/instrument/'
}
},
storeCoverage: {
options: {
dir: 'coverage/reports'
}
},
makeReport: {
src: 'coverage/reports/**/*.json',
options: {
type: 'lcov',
dir: 'coverage/reports',
print: 'detail'
}
},
// end - code coverage settings
coveralls: {
test: {
// LCOV coverage file relevant to every target
src: 'coverage/reports/lcov.info',
// When true, grunt-coveralls will only print a warning rather than
// an error, to prevent CI builds from failing unnecessarily (e.g. if
// coveralls.io is down). Optional, defaults to false.
force: false
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-coveralls');
// Default task(s).
grunt.registerTask('default', ['clean', 'jasmine_node:specs']);
grunt.registerTask('heroku', 'default');
grunt.registerTask('coverage', ['clean', 'env:coverage',
'instrument', 'jasmine_node:instrumented', 'storeCoverage', 'makeReport', 'coveralls:test']);
};