karma.cover.config.js
1.26 KB
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
const base = require('./karma.base.config.js');
module.exports = function coverConfig(config) {
config.set(Object.assign(base, {
// progress karma-htmlfile-reporter
// karma-html-detailed-reporter 如果作者修改了编码,可以考虑
reporters: ['progress', 'html', 'coverage'],
browsers: ['PhantomJS'],
singleRun: true,
htmlReporter: {
outputFile: '_report/units.html',
// Optional
pageTitle: 'ejs Tests',
subPageTitle: 'unit test',
groupSuites: true,
useCompactStyle: true,
useLegacyStyle: true,
},
coverageReporter: {
reporters: [
// generates ./coverage/lcov.info
{
type: 'lcovonly',
subdir: '.',
dir: '_coverage/',
},
{
type: 'json',
subdir: '.',
dir: '_coverage/',
},
// generates ./coverage/coverage-final.json
{
type: 'html',
subdir: '.',
dir: '_coverage/',
},
],
},
}));
};