forked from alexpalombaro/modernizr-webpack-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkarma.conf.js
41 lines (35 loc) · 999 Bytes
/
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
/* eslint-disable no-process-env */
var webpack = require('webpack');
var webpackConfig = require('./webpack.config');
var debug = !(process.env.NODE_ENV === 'production' || process.env.BUILD_ENV === 'travis');
var KARMA_ENTRY = './karma.entry.js';
var preprocessors = {};
preprocessors[KARMA_ENTRY] = 'webpack';
function makeDefaultConfig() {
return {
files: [KARMA_ENTRY],
singleRun: !debug,
autoWatch: debug,
frameworks: ['mocha', 'sinon-chai'],
preprocessors: preprocessors,
reporters: ['progress'],
browsers: (debug ? ['ChromeHeadless', 'Chrome'] : ['ChromeHeadless']),
webpack: {
plugins: webpackConfig.plugins
},
webpackMiddleware: {
noInfo: true
},
plugins: [
require('karma-webpack'),
require('karma-mocha'),
require('karma-sinon-chai'),
require('karma-chrome-launcher')
],
logLevel: 'INFO'
};
}
module.exports = function (config) {
config.set(makeDefaultConfig());
return config;
};