forked from vasanthk/react-es6-webpack-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 16
/
karma.config.js
47 lines (46 loc) · 1.26 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
40
41
42
43
44
45
46
47
var webpack = require('karma-webpack');
var webpackConfig = require('./webpack.config');
webpackConfig.module.loaders = [
{
test: /\.(js|jsx)$/, exclude: /(bower_components|node_modules)/,
loader: 'babel-loader'
}
];
webpackConfig.module.postLoaders = [{
test: /\.(js|jsx)$/, exclude: /(node_modules|bower_components|tests)/,
loader: 'istanbul-instrumenter'
}];
module.exports = function (config) {
config.set({
frameworks: [ 'jasmine' ],
files: [
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'tests/**/*_spec.js'
],
plugins: [
webpack,
'karma-jasmine',
'karma-chrome-launcher',
'karma-firefox-launcher',
'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: webpackConfig,
webpackMiddleware: { noInfo: true }
});
};