-
Notifications
You must be signed in to change notification settings - Fork 3
/
karma.conf.js
43 lines (41 loc) · 1.15 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
// Create custom launcher in case running with Travis
const launchers = {
Chrome_browser: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
};
module.exports = function (config) {
let karmaConf = {
logLevel: config.LOG_INFO,
browsers: ['Chrome', 'Firefox'],
concurrency: 1,
singleRun: true,
colors: true,
frameworks: ['mocha'],
files: ['test/setup/karma.js'],
preprocessors: {
'src/**/*.js': ['webpack', 'sourcemap'],
'test/setup/karma.js': ['webpack', 'sourcemap']
},
reporters: ['progress', 'coverage'],
webpack: {
...require('./webpack.config.js'),
externals: {}, //Need to remove externals otherwise they won't be included in test
devtool: 'inline-source-map', // Need to define inline source maps when using karma
mode: config.mode || 'development' // run in development mode by default to avoid minifying -> faster
},
webpackServer: {
noInfo: true
},
client: {
mocha: {
reporter: 'html',
timeout: 50000
}
}
};
karmaConf.customLaunchers = launchers;
karmaConf.browsers = ['Chrome_browser'];
config.set(karmaConf);
};