-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
37 lines (36 loc) · 1.16 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
var path = require('path')
module.exports = function(config) {
config.set({
frameworks: ['mocha', 'chai'],
files: ['test/index.js'],
preprocessors: {
'test/index.js': ['webpack', 'sourcemap']
},
webpack: require('./webpack.test.config'),
// 不显示 `webpack` 打包日志信息
webpackServer: {
noInfo: true
},
reporters: ['spec', 'coverage-istanbul'],
port: 9876, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless'],
autoWatch: false,
// singleRun: false, // Karma captures browsers, runs the tests and exits
concurrency: Infinity,
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
dir: path.join(__dirname, 'test/.coverage'),
fixWebpackSourcePaths: true,
skipFilesWithNoCoverage: true,
'report-config': {
// all options available at: https://github.com/istanbuljs/istanbuljs/blob/aae256fb8b9a3d19414dcf069c592e88712c32c6/packages/istanbul-reports/lib/html/index.js#L135-L137
html: {
// outputs the report in ./coverage/html
subdir: 'html'
}
}
}
})
}