-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathkarma.conf.js
More file actions
62 lines (56 loc) · 1.88 KB
/
karma.conf.js
File metadata and controls
62 lines (56 loc) · 1.88 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Coverage reporting breaks breakpoints
const debug = process.argv.includes('--debug');
console.warn(`Debug mode is enabled - code coverage will be disabled`);
module.exports = (config) => {
config.set({
browsers: ['ChromeHeadlessDebug'],
customLaunchers: {
ChromeHeadlessDebug: {
base: 'ChromeHeadless',
flags: [ '--remote-debugging-port=9333' ],
},
},
frameworks: ['jasmine'],
reporters: ['progress', ...(debug ? [] : ['coverage-istanbul'])],
files: [
{ pattern: './test/**/*.ts' }
],
preprocessors: {
'**/*.ts': ['webpack', 'sourcemap'],
},
webpack: {
node: { fs: 'empty' },
devtool: 'inline-source-map',
mode: 'development',
resolve: {
extensions: ['.js', '.ts', '.tsx', '.json']
},
module: {
rules: [
{test: /\.tsx?$/, use: [...(debug ? [] : ['coverage-istanbul-loader']), 'ts-loader']}
]
},
output: {
// Outputs absolute file paths instead of webpack:///path/to/file.extension
// This makes stacktrace paths clickable in a shell (e.g. VS Code)
devtoolModuleFilenameTemplate: function(info) {
return info.absoluteResourcePath;
},
},
},
webpackMiddleware: { stats: 'errors-only' },
coverageIstanbulReporter: {
dir: '.coverage',
reports: ['html', 'text-summary'],
'report-config': {
html: { subdir: 'html' }
},
// Don't run coverage on test/
instrumentation: {
excludes: [
'**/test/**'
]
}
}
});
};