forked from erizocosmico/react-es6-webpack-karma-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.config.js
39 lines (38 loc) · 1.14 KB
/
karma.config.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
var webpack = require('karma-webpack');
module.exports = function (config) {
config.set({
frameworks: [ 'jasmine' ],
files: [
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'tests/**/*_spec.js'
],
plugins: [webpack, 'karma-jasmine', 'karma-phantomjs-launcher', 'karma-coverage', 'karma-spec-reporter'],
browsers: [ 'PhantomJS' ],
preprocessors: {
'tests/**/*_spec.js': ['webpack'],
'src/**/*.js': ['webpack']
},
reporters: [ 'spec', 'coverage' ],
coverageReporter: {
dir: 'build/reports/coverage',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'lcov', subdir: 'report-lcov' },
{ type: 'cobertura', subdir: '.', file: 'cobertura.txt' }
]
},
webpack: {
module: {
loaders: [{
test: /\.(js|jsx)$/, exclude: /(bower_components|node_modules)/,
loader: 'babel-loader'
}],
postLoaders: [{
test: /\.(js|jsx)$/, exclude: /(node_modules|bower_components|tests)/,
loader: 'istanbul-instrumenter'
}]
}
},
webpackMiddleware: { noInfo: true }
});
};