-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
80 lines (75 loc) · 1.77 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
module.exports = function(grunt) {
var allSrc = [
'lib/*.js',
'test/lib/*.js',
'Gruntfile.js'
];
grunt.initConfig({
jscs: {
options: {
config: '.jscsrc',
esnext: true,
verbose: true,
requireCurlyBraces: [ 'if' ]
},
javascripts: {
src: allSrc
}
},
eslint: {
target: [
'.'
],
},
mocha_istanbul: {
src: ['test'],
options: {
reportFormats: ['html', 'cobertura']
}
},
mochaTest: {
local: {
options: 'test/mocha.opts',
src: ['test/lib/*.js']
},
ci: {
options: {
reporter: 'xunit',
captureFile: 'testreports.xml',
quiet: true,
clearRequireCache: true
},
src: ['test/lib/*.js']
}
},
watch: {
js: {
options: {
spawn: true,
interrupt: true
},
files: allSrc,
tasks: ['jshint', 'mochaTest:local']
}
}
});
[
'grunt-contrib-jshint',
'grunt-mocha-istanbul',
'grunt-open',
'grunt-mocha-test',
'grunt-contrib-watch',
'grunt-eslint'
].forEach(function(task) {
grunt.loadNpmTasks(task);
});
grunt.registerTask('dev', [
'eslint',
'mochaTest:local'
]);
grunt.registerTask('ci', [
'eslint',
'mochaTest:ci',
'mocha_istanbul'
]);
};