-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathkarma.conf.js
56 lines (52 loc) · 1.56 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
51
52
53
54
55
56
var webpack = require('webpack');
module.exports = function (config) {
var configuration = {
browsers: ['ChromeNoSandboxHeadless'],
customLaunchers: {
ChromeNoSandboxHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
// See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
'--headless',
'--disable-gpu',
// Without a remote debugging port, Google Chrome exits immediately.
' --remote-debugging-port=9222',
],
},
},
singleRun: true, //just run once by default
frameworks: [ 'mocha' ], //use the mocha test framework
files: [
'tests.webpack.js',
{pattern: '*.jpg', watched: false, included: false, served: true},
],
preprocessors: {
'tests.webpack.js': [ 'webpack', 'sourcemap' ] //preprocess with webpack and our sourcemap loader
},
reporters: ['progress', 'junit'],
// the default configuration
junitReporter: {
outputDir: 'results'
},
webpack: { //kind of a copy of your webpack config
devtool: 'inline-source-map', //just do inline source maps instead of the default
module: {
loaders: [{
test: /\.css$/,
loader: 'style-loader!css-loader'
}, {
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react']
}
}]
},
},
webpackServer: {
noInfo: true //please don't spam the console when running in karma!
}
};
config.set(configuration);
};