-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathkarma.config.js
63 lines (46 loc) · 1.19 KB
/
karma.config.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
63
module.exports = function(config) {
var options = {
frameworks: [
'jasmine'
],
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'node_modules/sinon/pkg/sinon.js',
'karma.entry.js'
],
preprocessors: {
'karma.entry.js': ['webpack', 'sourcemap']
},
// webpack config
webpack: require('./webpack.config.test'),
// webpack server config
webpackServer: {
noInfo: true
},
reporters: ['dots'],
logLevel: config.LOG_INFO,
autoWatch: true,
singleRun: false,
browserNoActivityTimeout: 180000, // 3 mins
customLaunchers: {
TRAVIS_CHROME: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
browsers: process.env.TRAVIS ? ['TRAVIS_CHROME'] : ['Chrome']
};
// additional options for coverage
if (process.argv.indexOf('--coverage') !== -1) {
options.singleRun = true;
options.reporters.push('coverage');
options.coverageReporter = {
type : 'lcov',
dir : 'tmp/coverage'
};
options.webpack.module.preLoaders = [
{ exclude: /(karma|node_modules|spec|vendor)/, loader: 'isparta', test: /\.js$/ }
];
}
config.set(options);
};