/
karma.conf.js
50 lines (49 loc) · 1.1 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
var path = require('path');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
browsers: ['Chrome'],
transports: ['websocket', 'polling'],
plugins: [
'karma-jasmine',
'karma-chrome-launcher',
'karma-webpack',
'karma-sourcemap-loader',
],
phantomjsLauncher: {
exitOnResourceError: true,
},
colors: true,
autoWatch: true,
singleRun: true,
// logLevel: config.LOG_ERROR,
listenAddress: '0.0.0.0',
hostname: 'localhost',
port: 9876,
files: [
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
{ pattern: 'src/**/*.spec.js', watched: false },
],
webpack: {
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
exclude: /(node_modules)/,
},
],
},
},
webpackMiddleware: {
stats: 'errors-only',
},
preprocessors: {
'./src/**/*.js': ['webpack', 'sourcemap'],
},
});
};