-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
57 lines (55 loc) · 1.42 KB
/
Gruntfile.js
File metadata and controls
57 lines (55 loc) · 1.42 KB
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
module.exports = (grunt) => {
grunt.loadNpmTasks('grunt-env')
grunt.loadNpmTasks('grunt-mocha-test')
grunt.loadNpmTasks('grunt-nodemon')
grunt.loadNpmTasks('grunt-run')
grunt.initConfig({
env: {
test: {
TESTING: true
},
local: {
TESTING: false,
MONGODB_URI: 'mongodb://localhost:27017/monash-ninja',
API_URL: 'http://localhost:3000',
API_VERSION: '1.0.0'
},
docker: {
TESTING: true
}
},
mochaTest: {
functional: {
options: {
reporter: 'spec',
timeout: '10000',
recursive: true
},
src: ['tests/functional/**/test*.js']
},
unit: {
options: {
reporter: 'spec',
timeout: '10000',
recursive: true
},
src: ['tests/unit/**/test*.js']
}
},
nodemon: {
local: {
script: 'app.js'
}
},
run: {
standard: {
exec: 'standard'
}
}
})
grunt.registerTask('spec:unit', ['env:test', 'run:standard', 'mochaTest:unit'])
grunt.registerTask('spec:functional', ['env:test', 'run:standard', 'mochaTest:functional'])
grunt.registerTask('spec', ['env:test', 'run:standard', 'mochaTest:unit', 'mochaTest:functional'])
grunt.registerTask('docker', ['env:docker', 'mochaTest:unit', 'mochaTest:functional'])
grunt.registerTask('serve', ['env:local', 'nodemon:local'])
}