-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
83 lines (74 loc) · 1.7 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
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jasmine_node: {
options: {
forceExit: true,
},
all: ['spec/']
},
jshint: {
src: ['public/js/*.js', 'server.js', 'models/*.js', 'routes/*.js', 'controllers/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
mocha_casperjs: {
options: {
},
files: {
src: ['test/*.spec.js']
}
},
mochacli: {
options: {
require: ['chai'],
reporter: 'spec',
timeout: 60000,
bail: true
},
all: ['test/*.selenium.js']
},
run: {
selenium_server: {
options: {
wait: false
},
exec: 'selenium-standalone start &>/dev/null'
}
},
stop: {
selenium_server: {
options: {
wait: false
},
exec: 'selenium-standalone stop &>/dev/null'
}
},
express: {
test: {
options: {
script: 'server.js'
}
}
},
mochaTest: {
specs: {
options: {
ui: 'bdd',
},
src: ['test/*.spec.js']
}
}
});
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-mocha-cli');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-casperjs');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('default', ['express:test', 'run:selenium_server', 'mochacli', 'stop:selenium_server']);
grunt.registerTask('hint', 'jshint')
grunt.registerTask('unittest', 'mochaTest');
};