-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
83 lines (73 loc) · 2.47 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
71
72
73
74
75
76
77
78
79
80
81
82
83
var path = require('path');
module.exports = function(config) {
config.set({
basePath: '',
files: [
'test/**/*.spec.js'
],
preprocessors: {
'test/**/*.js': ['webpack']
},
frameworks: ['jasmine'],
plugins: [
'karma-webpack',
'karma-jasmine',
'karma-sourcemap-loader',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-coverage-istanbul-reporter'
],
reporters: [
'progress',
'coverage-istanbul'
],
coverageIstanbulReporter: {
reports: ['html'], // reports can be any that are listed here: https://github.com/istanbuljs/istanbul-reports/tree/master/lib
dir: './coverage', // output directory
fixWebpackSourcePaths: true // if using webpack and pre-loaders, work around webpack breaking the source path
},
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',
exclude: path.resolve(__dirname, 'node_modules'),
query: {
presets: ['airbnb']
}
},
{
test: /\.json$/,
loader: 'json',
},
],
postLoaders: [ { //delays coverage til after tests are run, fixing transpiled source coverage error
test: /\.js$/,
exclude: /(test|node_modules|bower_components)\//,
loader: 'istanbul-instrumenter' }
]
},
externals: {
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
'react/addons': true,
}
},
webpackServer: {
noInfo: true //please don't spam the console when running in karma!
},
babelPreprocessor: {
options: {
presets: ['airbnb']
}
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
})
};