-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathGruntfile.js
97 lines (91 loc) · 2.27 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-open');
grunt.initConfig({
shell: {
options: {
stdout: true
},
docs: {
command: './node_modules/.bin/yuidoc -o ./docs ./src'
},
npm_install: {
command: 'npm install'
},
bower_install: {
command: 'node ./node_modules/bower/bin/bower install'
},
},
connect: {
docs: {
options: {
base: 'docs/',
port: 8888,
keepalive: true
}
},
coverage: {
options: {
base: 'coverage/',
port: 5555,
keepalive: true
}
},
test: {
options: {
base: './',
port: 8844
}
}
},
open: {
docs: {
path: 'http://localhost:8888'
},
coverage: {
path: 'http://localhost:5555'
}
},
karma: {
test: {
configFile: './test/karma.conf.js',
autoWatch: false,
singleRun: true
},
auto: {
configFile: './test/karma.conf.js',
autoWatch: true,
singleRun: false
},
ci: {
configFile: './test/karma.conf.js',
browsers: ['PhantomJS'],
autoWatch: false,
singleRun: true
},
coverage: {
configFile: './test/karma.conf.js',
autoWatch: false,
singleRun: true,
reporters: ['progress', 'coverage'],
preprocessors: {
'src/ngMidwayTester.js': ['coverage']
},
coverageReporter: {
type : 'html',
dir : 'coverage/'
}
}
}
});
//single run tests
grunt.registerTask('test', ['connect:test','karma:test']);
grunt.registerTask('travis', ['connect:test','karma:ci']);
grunt.registerTask('autotest', ['connect:test','karma:auto']);
grunt.registerTask('coverage', ['install','connect:test','karma:coverage','open:coverage','connect:coverage']);
grunt.registerTask('docs', ['gen-docs','open:docs','connect:docs']);
grunt.registerTask('gen-docs', ['install','shell:docs']);
grunt.registerTask('install', ['shell:npm_install','shell:bower_install']);
};