forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
92 lines (85 loc) · 2.89 KB
/
karma.conf.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
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
// {pattern: 'node_modules/sinon/chai.js', include: true},
{pattern: 'node_modules/chai/chai.js', include: true},
{pattern: 'node_modules/sinon/pkg/sinon.js', include: true},
'dist/avalon.test.js',
// 'karma/reconcile.js',
'karma/seed/core.js',
'karma/seed/browser.js',
'karma/seed/lang.js',
'karma/seed/cache.js',
'karma/seed/config.js',
'karma/filters/index.js',
'karma/vdom/index.js',
'karma/dom/index.js',
'karma/strategy/index.js',
'karma/component/index.js',
'karma/vmodel/index.js',
'karma/directives/text.js',
'karma/directives/css.js',
'karma/directives/controller.js',
'karma/directives/important.js',
'karma/directives/expr.js',
'karma/directives/effect.js',
'karma/directives/class.js',
'karma/directives/attr.js',
'karma/directives/html.js',
'karma/directives/visible.js',
'karma/directives/if.js',
'karma/directives/on.js',
'karma/directives/duplex.js',
'karma/directives/for.js',
'karma/directives/widget.js',
'karma/directives/hover.js',
'karma/directives/active.js',
'karma/directives/validate.js',
'karma/directives/rules.js',
],
exclude: [],
mochaReporter: {
output: 'autowatch',
colors: {
success: 'green',
info: 'magenta',
warning: 'cyan',
error: 'bgRed'
}
},
reporters: ['mocha', 'coverage'],
preprocessors: {
// source files, that you wanna generate coverage for
// do not include tests or libraries
// (these files will be instrumented by Istanbul)
'dist/avalon.test.js': ['coverage']
},
coverageReporter: {
type: 'html',
dir: 'coverage/'
},
port: 9858,
colors: true,
logLevel: config.LOG_INFO,
//autoWatch为true,Karma将自动执行测试用例
autoWatch: true,
//http://www.cnblogs.com/NetSos/p/4371075.html
browsers: ['Chrome'],
singleRun: false,
plugins: [
'karma-mocha',
'karma-sinon',
'karma-coverage',
'karma-mocha-reporter',
'karma-firefox-launcher',
'karma-safari-launcher',
'karma-chrome-launcher',
'karma-ie-launcher',
'karma-opera-launcher',
'karma-safari-launcher'
]
})
}
//使用 karma start