-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathkarma.conf.js
50 lines (42 loc) · 1.51 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
/* eslint-env node */
/* eslint max-len: 0 */
var commonConfig = require('./karma-conf.common.js');
module.exports = function(config) {
commonConfig(config); // apply shared configuration
var sourcePreprocessors = 'coverage';
function isDebug(argument) {
return argument === '--debug';
}
if (process.argv.some(isDebug)) {
sourcePreprocessors = [];
}
config.set({
// Preprocess so we can gather coverage
preprocessors: {
'app/**/*.js': sourcePreprocessors // remove coverage here if we want to debug a test
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha', 'coverage'],
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// optionally, configure the reporter
coverageReporter: {
dir: 'coverage/',
check: {
emitWarning: true, // don't fail the tests
global: {
statements: 15 // minimum coverage of 15%
}
},
reporters: [
{ type: 'html', subdir: '.' },
{ type: 'lcovonly', subdir: '.', file: 'lcov.info' }
]
}
});
};