-
Notifications
You must be signed in to change notification settings - Fork 28
/
karma.conf.js
62 lines (60 loc) · 1.92 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
const path = require('path');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config.dev');
const testPath = path.join(__dirname, 'test');
const srcPath = path.join(__dirname, 'app');
module.exports = (config) => {
config.set({
frameworks: [ 'mocha', 'intl-shim', 'chai-immutable', 'sinon-chai' ],
files: [
'test/index.js'
],
preprocessors: {
'test/index.js': [ 'webpack', 'electron' ]
},
webpack: {
resolve: webpackConfig.resolve,
plugins: webpackConfig.plugins,
module: {
noParse: webpackConfig.module.noParse,
preLoaders: [
{
test: /\.js$/,
loader: 'isparta',
include: [ srcPath ]
}
],
loaders: [
{
test: /\.js$/,
loader: 'babel',
include: [ testPath ]
},
{
test: /\.styl$/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!stylus'
}
]
},
externals: {
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
},
target: webpackConfig.target
},
webpackMiddleware: {
noInfo: true
},
coverageReporter: {
reporters: [
{ type: 'text-summary' },
{ type: 'lcov', dir: 'test/coverage' }
]
},
reporters: [ 'progress', 'coverage' ],
browsers: [ 'Electron' ],
singleRun: true
});
};