-
Notifications
You must be signed in to change notification settings - Fork 17
/
karma.conf.js
70 lines (53 loc) · 1.57 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Karma configuration
var path = require('path');
module.exports = function(config) {
config.set({
// ... normal karma configuration
files: [
// all files ending in "_test"
'test/*_test.jsx',
'test/**/*_test.jsx'
// each file acts as entry point for the webpack configuration
],
frameworks: ['mocha'],
browsers: ['Chrome'],
preprocessors: {
// add webpack as preprocessor
'test/data/*.jsx': ['webpack'],
'test/*_test.jsx': ['webpack'],
'test/**/*_test.jsx': ['webpack']
},
webpack: {
// karma watches the test entry points
// (you don't need to specify the entry option)
// webpack watches dependencies
// webpack configuration
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/',
filename: 'app.js',
chunkFilename: '[chunkhash].js'
},
resolve: {
extensions: ['', '.js', '.jsx', '.styl'],
packageMains: ["webpack", "browser", "web", "browserify", "main"]
},
module: {
loaders: [
{test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/},
{test: /.*\.(gif|png|jpg)$/, loaders: ['file?hash=sha512&digest=hex&size=16&name=[hash].[ext]', 'image-webpack-loader?optimizationLevel=7&interlaced=false']}
]
}
},
webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
noInfo: true
},
plugins: [
require('karma-chrome-launcher'),
require('karma-mocha'),
require('karma-webpack')
]
});
};