-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
56 lines (53 loc) · 1.29 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
'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: {
test: {
options: {
reporter: 'spec',
clearRequireCache: false
},
src: ['<%= tests %>']
},
spec: {
options: {
reporter: 'spec',
clearRequireCache: false
},
src: ['<%= specs %>']
}
},
env: {
test: {
RESPONSE_FAIL_ACTION: 'error',
CLIENT_SECRET: '78c74c028b276e5db1e37ef4d06ba747',
AUDIENCE: 'nZcyZaiMFMqsnpy6b1Gt'
}
},
watch: {
app: {
files: ['<%= app %>', '<%= tests %>'],
tasks: ['lint', 'test']
},
specs: {
files: ['<%= 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']);
};