-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathkarma.conf.js
70 lines (62 loc) · 1.25 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
var path = require('path');
var localLaunchers = {
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=9333'
]
}
};
module.exports = function(config) {
config.set({
frameworks: ['mocha', 'chai-sinon'],
reporters: ['mocha'],
browsers: ['ChromeNoSandboxHeadless'],
customLaunchers: localLaunchers,
files: [
'test/_setup.js',
'test/**/*.js'
],
preprocessors: {
'test/**/*.js': ['webpack'],
'src/**/*.js': ['webpack'],
'**/*.js': ['sourcemap']
},
mochaReporter: {
showDiff: true
},
webpack: {
mode: 'development',
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
sourceMap: 'inline',
presets: ['@babel/env'],
plugins: [
['@babel/plugin-transform-react-jsx', { pragma:'h' }]
]
}
}
]
},
resolve: {
modules: [__dirname, 'node_modules'],
alias: {
src: __dirname+'/src'
}
}
},
webpackMiddleware: {
noInfo: true
}
});
};