-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkarma.config.js
85 lines (83 loc) · 2.12 KB
/
karma.config.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//https://github.com/export-mike/react-redux-boilerplate
const path = require('path');
const webpack = require('webpack');
// See issues for details on parts of this config.
// https://github.com/airbnb/enzyme/issues/47
// had issues loading sinon as its a dep of enzyme
const argv = require('minimist')(process.argv.slice(2));
module.exports = (config) => {
config.set({
browsers: [ 'Chrome' ],
singleRun: argv.watch ? false : true,
frameworks: [ 'mocha' ],
files: [
'tests.webpack.js'
],
preprocessors: {
'tests.webpack.js': ['webpack', 'sourcemap']
},
reporters: [ 'dots' ],
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|\.jsx)$/,
loader: 'babel',
exclude: path.resolve(__dirname, 'node_modules'),
query: {
presets:['airbnb','es2015','stage-0','react']
}
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /(\.css|\.scss)$/,
loader: 'style!css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass?sourceMap'
},
{
test: /sinon\.js$/,
loader: 'imports?define=>false,require=>false'
}
]
},
externals: {
jsdom: 'window',
cheerio: 'window',
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': 'window',
'text-encoding': 'window'
},
resolve: {
extensions: ['','.jsx', '.scss', '.js', '.json'],
alias: {
sinon: 'sinon/pkg/sinon'
}
}
},
webpackServer: {
noInfo: true //please don't spam the console when running in karma!
}/*,
plugins: [
'karma-webpack',
'karma-jasmine',
'karma-sourcemap-loader',
'karma-chrome-launcher',
'karma-phantomjs-launcher'
],
babelPreprocessor: {
options: {
presets: ['airbnb']
}
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,*/
})
};