-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.config.js
54 lines (45 loc) · 1.15 KB
/
karma.config.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
const webpackConfig = require('./build/webpack.config');
const testFiles = 'source/**/__tests__/*.test.ts';
module.exports = (config) => {
config.set({
singleRun: true,
files: [
testFiles,
],
frameworks: ['mocha'],
reporters: ['mocha', 'coverage-istanbul'],
browsers: ['ChromeHeadlessNoSandbox'],
// `--no-sandbox` is required by jenkins
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
],
},
},
// Diffs are disabled by default
mochaReporter: {
showDiff: true,
},
// We need to preprocess test files with webpack
preprocessors: {
[testFiles]: 'webpack',
},
coverageIstanbulReporter: {
reports: ['html', 'text', 'lcovonly'],
dir: 'coverage',
},
// karma-webpack config options
webpack: webpackConfig('test'),
// Timeout settings
browserNoActivityTimeout: 60000,
browserDisconnectTolerance: 3,
// settings for webpack dev middleware
webpackMiddleware: {
// Disable build stats
stats: 'errors-only',
logLevel: 'warn',
},
});
};