-
Notifications
You must be signed in to change notification settings - Fork 12
/
karma.conf.js
38 lines (37 loc) · 1.1 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
var webpack = require('webpack');
module.exports = function (config) {
config.set({
browsers: [ 'PhantomJS' ], //run in Chrome
autoWatch: true,
singleRun: true,
frameworks: [ 'mocha' ], //use the mocha test framework
files: [
'tests.webpack.js' //just load this file
],
preprocessors: {
'tests.webpack.js': [ 'webpack', 'sourcemap' ] //preprocess with webpack and our sourcemap loader
},
reporters: [ 'dots', '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: /\.js$/, loader: 'babel-loader' }
],
postLoaders: [ {
test: /\.js$/,
exclude: /(__test__|node_modules|examples)\//,
loader: 'istanbul-instrumenter'
} ]
}
},
webpackServer: {
noInfo: true //please don't spam the console when running in karma!
},
coverageReporter: {
type: 'lcov',
dir: 'coverage',
subdir: '.'
}
});
};