forked from madnight/githut
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.babel.js
More file actions
47 lines (44 loc) · 1.2 KB
/
karma.conf.babel.js
File metadata and controls
47 lines (44 loc) · 1.2 KB
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
import wpConf from './webpack.config.babel.js'
import { initial } from 'lodash/fp'
wpConf.entry = {}
// filter out WebpackBrowserPlugin for tests
wpConf.plugins = wpConf.plugins | initial
const karma_config = {
browsers: ['Firefox'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
reporters: ['mocha'],
singleRun: true,
frameworks: ['mocha'],
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'test/setupTests.js',
'test/**/*.js'
],
preprocessors: {
'test/**/*.js': ['webpack'],
'src/**/*.js': ['webpack']
},
webpack: wpConf,
webpackServer: {
noInfo: true
}
}
module.exports = config => {
config.set(karma_config)
if (process.env.TRAVIS)
config.browsers = [
// 'Chrome_travis_ci',
// Chrome is atm buggy https://github.com/karma-runner/karma/issues/1656
'Firefox']
if (process.env['CHROME'])
config.browsers = ['Chrome_travis_ci']
if (process.env['BROWSERS'])
config.browsers = ['Chrome', 'Firefox']
if (process.env['LOOP'])
config.singleRun = false
}