-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
47 lines (44 loc) · 1.28 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
// Create custom launcher in case running with Travis
const launchers = {
Chrome_browser: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required']
}
};
module.exports = function (config) {
let karmaConf = {
logLevel: config.LOG_INFO,
browserDisconnectTimeout: 30000,
browserNoActivityTimeout: 60000,
customLaunchers: launchers,
browsers: [],
concurrency: 1,
singleRun: true,
colors: true,
frameworks: ['mocha'],
files: ['test/setup/karma.js'],
preprocessors: {
'src/**/*.ts': ['webpack', 'sourcemap'],
'test/setup/karma.js': ['webpack', 'sourcemap']
},
reporters: ['mocha', '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);
};