-
Notifications
You must be signed in to change notification settings - Fork 31
/
karma.conf.js
68 lines (65 loc) · 1.61 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
const compact = require('lodash/compact');
const env = require('./env');
const ci = p => (env.isCI ? p : null);
const coverageDir = process.env.COVERAGE_DIR || 'coverage';
module.exports = (config) => {
/* eslint-disable global-require */
const webpackConfig = require('./webpack.config');
webpackConfig.devtool = 'inline-source-map';
webpackConfig.entry = () => ({ });
config.set({
frameworks: ['mocha', 'source-map-support'],
files: [
'tests.webpack.js',
],
preprocessors: {
'tests.webpack.js': ['webpack'],
},
plugins: [
'karma-mocha',
'karma-mocha-reporter',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-source-map-support',
'karma-junit-reporter',
'karma-coverage',
'karma-remap-coverage',
'karma-webpack',
],
reporters: compact([
'mocha',
'coverage',
'remap-coverage',
ci('junit'),
]),
mochaReporter: {
output: 'autowatch',
showDiff: true,
},
junitReporter: {
outputFile: `${process.env.CIRCLE_TEST_REPORTS}/junit/test-results.xml`,
},
coverageReporter: {
type: 'in-memory',
},
remapCoverageReporter: {
'text-summary': null,
html: `${coverageDir}/html`,
json: `${coverageDir}/coverage.json`,
lcovonly: `${coverageDir}/coverage.lcov`,
},
port: 9876,
colors: true,
logLevel: config.LOG_ERROR,
browsers: ['Chrome'],
singleRun: false,
concurrency: Infinity,
webpack: webpackConfig,
webpackServer: {
stats: {
chunks: false,
},
noInfo: true,
},
});
};