forked from clauderic/react-infinite-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
59 lines (57 loc) · 1.55 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
var path = require('path');
process.env.NODE_ENV = 'testing';
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [{pattern: 'test/**/*.test.js', watched: false, included: true, served: true}],
preprocessors: {
'src/**/*.js': ['webpack', 'sourcemap', 'coverage'],
'test/**/*.js': ['webpack', 'sourcemap']
},
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$/,
loaders: ['babel?' + JSON.stringify({presets: ['es2015', 'react', 'stage-0', 'stage-1', 'stage-2']}), 'isparta'],
exclude: path.resolve(__dirname, 'node_modules')
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.scss$/i,
loaders: ['style', 'css?sourceMap&modules&importLoaders=1&localIdentName=Cal__[name]__[local]!postcss!sass?sourceMap']
}
]
},
externals: {
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
},
webpackServer: {
noInfo: true //please don't spam the console when running in karma!
},
babelPreprocessor: {
options: {
presets: ['airbnb']
}
},
reporters: ['progress', 'coverage'],
coverageReporter: {
reporters: [{type: 'lcov'}]
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
})
};