-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkarma.conf.ts
57 lines (51 loc) · 1.42 KB
/
karma.conf.ts
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
import webpackConfig from './webpack.config';
export default (config: any) => {
const webpackOptions = { hmr: false, test: true, coverage: false };
config.set({
client: {
captureConsole: true,
},
files: [
{ pattern: 'spec.module.js' },
],
preprocessors: {
'**/spec.module.js': ['webpack', 'sourcemap'],
},
browsers: ['ChromeCustom'],
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--headless',
'--disable-gpu',
'--remote-debugging-port=9222',
],
},
},
frameworks: [
'jasmine',
],
reporters: ['progress'],
mime: {
'text/x-typescript': ['ts', 'tsx'],
},
webpackMiddleware: {
stats: 'errors-only',
},
});
if (process.argv.indexOf('--coverage') !== -1) {
webpackOptions.coverage = true;
config.set({
reporters: ['progress', 'coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['text'],
fixWebpackSourcePaths: true,
skipFilesWithNoCoverage: true,
},
});
}
config.set({
webpack: webpackConfig(webpackOptions),
});
};