forked from krujos/willitconnect
-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
43 lines (40 loc) · 1.11 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
const webpackConfig = require('./webpack.config');
delete webpackConfig.entry;
delete webpackConfig.output;
delete webpackConfig.plugins;
webpackConfig.externals = Object.assign({}, webpackConfig.externals, {
'jsdom': 'window',
'cheerio': 'window',
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
'react/addons': true,
'text-encoding': 'window'
});
module.exports = karma => {
const config = {
basePath: ``,
frameworks: [ 'mocha', 'chai' ],
files: ['tests.webpack.js'],
plugins: [
'karma-phantomjs-launcher',
'karma-chai',
'karma-mocha',
'karma-sourcemap-loader',
'karma-webpack',
'karma-mocha-reporter'
],
preprocessors: {
'tests.webpack.js': [ 'webpack' ]
},
reporters: [ 'mocha' ],
webpack: webpackConfig,
webpackServer: {
noInfo: true
},
autoWatch: true,
colors: true
};
config.logLevel = config.LOG_INFO;
config.browsers = [ 'PhantomJS' ];
karma.set(config)
};