forked from ampproject/ampstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
50 lines (46 loc) · 1.07 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
const conf = require('./tasks/config');
module.exports = function (config) {
const configuration = {
basePath: '.',
singleRun: true,
autoWatch: false,
autoWatchBatchDelay: 500,
logLevel: 'INFO',
browsers: [
'Chrome'
],
frameworks: [
'mocha'
],
files: [
'node_modules/es6-shim/es6-shim.js',
`${conf.src.configurator}/**/*.spec.js`
],
preprocessors: {
[`${conf.src.configurator}/**/*.spec.js`]: [
'webpack'
]
},
reporters: ['progress'],
webpack: require('./webpack.config.js')({
test: true
}),
webpackMiddleware: {
noInfo: true
},
plugins: [
require('karma-mocha'),
require('karma-webpack'),
require('karma-chrome-launcher')
]
};
// Get our passed args
const args = process.argv;
// Check the passed client args
// http://karma-runner.github.io/1.0/config/configuration-file.html
if (args.includes('--auto-watch')) {
configuration.singleRun = false;
configuration.autoWatch = true;
}
config.set(configuration);
};