-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
51 lines (48 loc) · 1.2 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
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
app: ['./*.js', './lib/**/*.js'],
tests: ['./test/**/*.js'],
specs: ['./spec/**/*.js'],
eslint: {
target: ['<%= app %>', '<%= tests %>', '<%= specs %>']
},
mochaTest: {
options: {
reporter: 'spec',
clearRequireCache: false,
timeout: 10000
},
test: {
src: ['<%= tests %>']
},
spec: {
src: ['<%= specs %>']
}
},
env: {
test: {
RESPONSE_FAIL_ACTION: 'error'
}
},
watch: {
tests: {
files: ['<%= app %>', '!./lib/server.js', '!./lib/handlers/*.js', '<%= tests %>'],
tasks: ['lint', 'test']
},
specs: {
files: ['./lib/server.js', './lib/handlers/*.js', '<%= specs %>'],
tasks: ['lint', 'spec']
}
},
retire: {
node: ['node']
}
});
grunt.registerTask('lint', 'eslint');
grunt.registerTask('test', ['env:test', 'mochaTest:test']);
grunt.registerTask('spec', ['env:test', 'mochaTest:spec']);
grunt.registerTask('ci', ['retire', 'default']);
grunt.registerTask('default', ['lint', 'test', 'spec']);
};