-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
62 lines (62 loc) · 1.87 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
module.exports = (config) => {
config.set({
frameworks: ['mocha', 'chai'],
files: [
'./tests-config/index.js'
],
// list of files to exclude
exclude: [],
reporters: ['mocha', 'coverage'],
port: 1919, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless', 'Firefox'],
autoWatch: true,
autoWatchBatchDelay: 1000,
// Karma captures browsers, runs the tests and exits
singleRun: false,
concurrency: Infinity,
preprocessors: {
// preprocess with webpack and sourcemap loader
'./tests-config/index.js': ['webpack', 'sourcemap']
},
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-chai',
'karma-mocha',
'karma-sourcemap-loader',
'karma-webpack',
'karma-coverage',
'karma-mocha-reporter'
],
webpack: {
// just do inline source maps instead of the default
devtool: 'inline-source-map',
module: {
rules: [{
test: /\.js$/,
enforce: 'post',
use: { loader: 'istanbul-instrumenter-loader', options: { esModules: true } },
exclude: /(_test|lib|node_modules)\//
}]
}
},
webpackMiddleware: {
stats: 'errors-only'
},
webpackServer: {
noInfo: true
},
// configure the reporter
coverageReporter: {
includeAllSources: true,
fixWebpackSourcePaths: true,
dir: './coverage/',
reporters: [
{ type: 'html' },
{ type: 'text' }
]
}
});
};