-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathkarma.config.js
More file actions
55 lines (53 loc) · 1.37 KB
/
karma.config.js
File metadata and controls
55 lines (53 loc) · 1.37 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
44
45
46
47
48
49
50
51
52
53
54
55
/* eslint vars-on-top: 0, no-var: 0 */
require('babel-register');
var argv = require('yargs').argv;
var webpackCommon = require('./tools/config').webpackCommon;
module.exports = function karmaConfig(config) {
config.set({
browsers: ['PhantomJS'],
singleRun: !argv.watch,
frameworks: ['mocha', 'chai'],
reporters: ['spec'],
files: [
'./node_modules/babel-polyfill/dist/polyfill.js',
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'./tests/**/*.js*',
],
preprocessors: {
'./tests/**/*.js*': ['webpack', 'sourcemap'],
},
webpack: Object.assign({}, webpackCommon, {
devtool: 'inline-source-map',
resolve: Object.assign({}, webpackCommon.resolve, {
alias: {
sinon: 'sinon/pkg/sinon',
},
}),
module: Object.assign({}, webpackCommon.module, {
noParse: [
/node_modules\/sinon\//,
],
}),
node: {
fs: 'empty',
},
externals: {
jsdom: 'window',
cheerio: 'window',
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': 'window',
},
}),
webpackMiddleware: {
noInfo: true,
},
plugins: [
'karma-mocha',
'karma-chai',
'karma-webpack',
'karma-phantomjs-launcher',
'karma-spec-reporter',
'karma-sourcemap-loader',
],
});
};