-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
41 lines (41 loc) · 1.4 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
module.exports = function (config) {
config.set({
browsers: ['Chrome'], // run in Chrome
singleRun: true, // just run once by default
frameworks: ['mocha'], // use the mocha test framework
files: [
'webpack.test.config.js' // just load this file
],
plugins: ['karma-chrome-launcher', 'karma-mocha',
'karma-sourcemap-loader', 'karma-webpack', 'karma-coverage',
'karma-mocha-reporter'
],
preprocessors: {
'webpack.test.config.js': ['webpack', 'sourcemap'] // preprocess with webpack and our sourcemap loader
},
reporters: ['mocha', 'coverage'], // report results in this format
webpack: { // kind of a copy of your webpack config
devtool: 'inline-source-map', // just do inline source maps instead of the default
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader'
}
],
postLoaders: [{ // delays coverage til after tests are run, fixing transpiled source coverage error
test: /\.jsx?$/,
exclude: /(__test__|node_modules)\//,
loader: 'istanbul-instrumenter'
}]
}
},
webpackServer: {
noInfo: true // please don't spam the console when running in karma!
},
coverageReporter: {
type: 'html', // produces a html document after code is run
dir: 'coverage/' // path to created html doc
}
});
};