-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
41 lines (39 loc) · 1.18 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
//based off of
//https://www.codementor.io/reactjs/tutorial/test-reactjs-components-karma-webpack
var webpack = require('webpack');
var path = require('path');
module.exports = function(config) {
config.set({
browsers: [ 'PhantomJS' ],
singleRun: false, //just run once by default
autoWatch: true,
frameworks: [ 'mocha', 'es6-shim' ],
files: [
'tests.webpack.js' //just load this file
],
preprocessors: {
'tests.webpack.js': [ 'webpack', 'sourcemap' ] //preprocess with webpack and our sourcemap loader
},
reporters: [ 'dots' ], //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$/,
include: [
path.resolve(__dirname, "src")
],
loader: 'babel-loader'
}
]
},
resolve: {
modulesDirectories: [".", "node_modules"],
extensions: ["", ".webpack.js", ".js"]
}
},
webpackServer: {
noInfo: true //please don't spam the console when running in karma!
}
});
};