-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
109 lines (99 loc) · 3.56 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
env: {
test: {
CATALOG_API_TEST_SERVER: 'http://microservices-catalogapi-uparulek-142.mybluemix.net'
}
},
mochaTest: {
'server-side': {
options: {
reporter: 'json',
clearRequireCache: true,
colors: true,
quite: true,
captureFile: 'tests/server/mochatest.json',
gruntLogHeader: false
},
src: ['tests/server/*.spec.js']
},
'server-side-spec': {
options: {
reporter: 'spec',
clearRequireCache: true,
colors: true,
quite: true
},
src: ['tests/server/*.spec.js']
},
'fvt': {
options: {
reporter: 'json',
clearRequireCache: true,
colors: true,
quite: true,
captureFile: 'tests/fvt/mochafvttest.json'
},
src: ['tests/fvt/*.spec.js']
},
'fvt-spec': {
options: {
reporter: 'spec',
clearRequireCache: true,
colors: true,
quite: true
},
src: ['tests/fvt/*.spec.js']
}
},
clean: {
options: {
force: true,
expand: true
},
coverage: ['tests/server/coverage', 'tests/server/mochatest.json', 'tests/fvt/mochafvttest.json']
},
copy: {
resourcesForInstrumented: {
nonull: true,
files: [{
expand: true,
dest: 'tests/server/coverage/instrumented',
src: ['routes/db.js']
}]
}
},
instrument: {
files: ['routes/items.js'],
options: {
lazy: false,
basePath: 'tests/server/coverage/instrumented/'
}
},
storeCoverage: {
options: {
dir: 'tests/server/coverage/reports'
}
},
makeReport: {
src: 'tests/server/coverage/reports/*.json',
options: {
type: 'html',
type: 'json-summary',
dir: 'tests/server/coverage/reports',
file: 'coverage-summary.json'
//print: 'detail'
}
}
});
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-env');
grunt.registerTask('dev-test', ['env:test', 'clean:coverage', 'copy:resourcesForInstrumented', 'instrument', 'mochaTest:server-side-spec']);
grunt.registerTask('dev-test-cov', ['env:test', 'clean:coverage', 'copy:resourcesForInstrumented', 'instrument', 'mochaTest:server-side', 'storeCoverage', 'makeReport']);
grunt.registerTask('dev-fvtspec', ['env:test', 'clean:coverage', 'mochaTest:fvt-spec']);
grunt.registerTask('dev-fvt', ['env:test', 'clean:coverage', 'mochaTest:fvt']);
};