-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathkarma.conf.js
More file actions
43 lines (40 loc) · 1.12 KB
/
Copy pathkarma.conf.js
File metadata and controls
43 lines (40 loc) · 1.12 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
const webpackConfig = require('./webpack.config');
delete webpackConfig.entry;
delete webpackConfig.output;
delete webpackConfig.optimization;
webpackConfig.externals = Object.assign({}, webpackConfig.externals, {
'jsdom': 'window',
'cheerio': 'window',
'text-encoding': 'window'
});
module.exports = karma => {
const config = {
basePath: ``,
frameworks: [ 'mocha', 'chai', 'sinon-chai' ],
files: ['tests.webpack.js'],
plugins: [
'karma-chrome-launcher',
'karma-chai',
'karma-mocha',
'karma-sinon',
'karma-sinon-chai',
'karma-sourcemap-loader',
'karma-webpack',
'karma-mocha-reporter'
],
preprocessors: {
'tests.webpack.js': [ 'webpack', 'sourcemap' ]
},
reporters: [ 'mocha' ],
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
autoWatch: true,
colors: true,
browsers: [ 'ChromeHeadless' ],
singleRun: false,
logLevel: karma.LOG_INFO
};
karma.set(config);
};