-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
karma.conf.js
37 lines (36 loc) · 953 Bytes
/
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
let path = require('path')
if (process.argv.indexOf('--browsers') < 0) {
process.env.CHROME_BIN = require('puppeteer').executablePath()
}
const webpackCfg = require('./webpack.config')
module.exports = function(config) {
process.env.BABEL_ENV = 'test'
let reporters = ['mocha', 'coverage']
// don't run coverage in watch (CI) mode
if (config.autoWatch && !config.singleRun) {
reporters = ['mocha']
}
config.set({
basePath: '',
browsers: ['ChromeHeadless'],
files: ['test/loadTests.js'],
captureTimeout: 60000,
frameworks: ['mocha', 'chai'],
client: {
mocha: {}
},
colors: true,
singleRun: true,
logLevel: config.LOG_INFO,
reporters: reporters,
preprocessors: {
'test/loadTests.js': ['webpack'],
'src/**/*.js': 'coverage'
},
webpack: webpackCfg,
coverageReporter: {
dir: 'coverage/',
reporters: [{ type: 'html' }, { type: 'text' }]
}
})
}