Repository navigation
Expand file tree
/
Copy pathgruntfile.js
More file actions
executable file
·68 lines (61 loc) · 2.06 KB
/
Copy pathgruntfile.js
File metadata and controls
executable file
·68 lines (61 loc) · 2.06 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
58
59
60
61
62
63
64
65
66
67
68
module.exports = function(grunt) {
grunt.initConfig({
shell:{
updateWebdriver: {
command: 'npm run update-webdriver',
},
serverAsync: {
command: 'node server.js',
options: {
async: true,
execOptions: {
cwd: './'
},
},
},
},
run: {
server: {
args: ['./server.js']
},
},
karma: {
unit: {
configFile: './test/karma.conf.js'
},
continuous: {
configFile: './test/karma.conf.js',
singleRun: true
},
},
watch: {
karma: {
files: ['client/scripts/**/*.js', 'test/unit/client/**/*.js'],
tasks: ['karma:unit:run']
},
},
protractor: {
options: {
configFile: "./test/karma-e2e.conf.js",
keepAlive: false, // The grunt process stops when the test fails.
noColor: false, // We use colors in its output.
args: { }
},
all: { },
},
});
grunt.loadNpmTasks('grunt-shell-spawn');
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('unitDEV', ['karma:unit', 'watch']);
grunt.registerTask('unitCI', ['karma:continuous']);
grunt.registerTask('serverAsync', ['shell:serverAsync']);
grunt.registerTask('updateWebdriver', ['shell:updateWebdriver']);
grunt.registerTask('server', ['run:server']);
grunt.registerTask('e2eCI', ['serverAsync', 'protractor']);
grunt.registerTask('e2eDEV', ['protractor']);
grunt.registerTask('testDEV', ['updateWebdriver', 'unitDEV', 'e2eDEV']);
grunt.registerTask('testCI', ['updateWebdriver', 'unitCI', 'e2eCI']);
};