-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkarma.conf.js
44 lines (40 loc) · 1.16 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
module.exports = function (config) {
var webpackConfig = require('./webpack.config.js');
var minimist = require('minimist');
var TARGET = minimist(process.argv.slice(2)).TARGET || 'PROD';
var configObject = {
basePath: 'src',
frameworks: ['jasmine'],
files: ['index.spec.js'],
reporters: ['dots'],
preprocessors: {
'index.spec.js': ['webpack', 'sourcemap']
},
webpack: {
module: webpackConfig.module,
resolve: webpackConfig.resolve,
devtool: 'inline-source-map'
},
customLaunchers: {
FlsChromeHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
'--headless',
'--disable-gpu',
' --remote-debugging-port=9222',
]
}
},
webpackMiddleware: {
noInfo: true
}
};
if (TARGET === 'PROD') {
configObject.browsers = ['FlsChromeHeadless'];
}
if (TARGET === 'DEV') {
configObject.browsers = ['Chrome'];
}
config.set(configObject);
};