-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
64 lines (57 loc) · 1.8 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
var path = require('path');
var isTravis = process.env.TRAVIS || false;
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
'src/**/__test__/**/*.js'
],
preprocessors: {
// add webpack as preprocessor
'src/**/*.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$/,
loader: 'babel-loader',
exclude: path.resolve(__dirname, 'node_modules'),
query: {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy'],
}
}, {
test: /\.json$/,
loader: 'json',
}, ]
},
externals: {
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
},
webpackServer: {
noInfo: true //please don't spam the console when running in karma!
},
plugins: [
'karma-webpack',
'karma-mocha',
'karma-sourcemap-loader',
'karma-phantomjs-launcher'
],
babelPreprocessor: {
options: {
presets: []
}
},
browsers:["PhantomJS"],
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
singleRun: isTravis,
})
};