-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
67 lines (52 loc) · 1.8 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
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function(config) {
config.set({
// 基路径:表示karma从那个位置开始找文件
basePath: '',
// 框架
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client: {
clearContext: false
},
coverageIstanbulReporter: {
// 覆盖率报告方式
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
dir: './coverage/',
'report-config': {
html: {
// outputs the report in ./coverage/html
subdir: 'html'
}
},
},
// 指定angular cli环境
angularCli: {
environment: 'dev'
},
// 结果报表
reporters: ['progress', 'coverage-istanbul', 'kjhtml'],
// 服务器端口
port: 9876,
// 报表中是否有颜色区分
colors: true,
// 输出的日志级别
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// 文件变化是否自动刷新
autoWatch: true,
// 测试环境
browsers: ['Chrome'],
// 是否依附浏览器运行
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};