-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathkarma.conf.js
More file actions
96 lines (95 loc) · 2.65 KB
/
karma.conf.js
File metadata and controls
96 lines (95 loc) · 2.65 KB
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
86
87
88
89
90
91
92
93
94
95
96
'use strict';
var path=require('path');
module.export=function(config){
if(process.env.RELEASE){
config.singleRun = true;
}
config.set({
basePath:'../',
frameworks:['mocha','chai'],
files:[
{pattern:'test/index.js',included:true,watch:false}],
exclude:['node_modules/'],
preprocessors:{
'test/index.js':['webpack','sourcemap'],
},
webpack:{
devtool:'inline-source-map',
module:{
noParse:[
/node_modules\/sinon//,
],
loaders:[{
test:/\.js$/,
include:[
/src|test|recharts/,
],
exclude:/node_modules/,
loader:'babel',
},{
test:/\.json$/,
loader:'json',
}],
postLoaders:[{
test:/\.js$/,
include:/src/,
exclude:/node_modules/,
loader:'istanbul-instrumenter',
}],
},
externals:{
'jsdom':'window',
'react/lib/ExectionEnvironment':true,
'react/lib/ReactContext':'window',
'text-encoding':'window',
},
resolve:{
alias:{
'sinon':'sinon/pkg/sinon',
'recharts':path.resolve('./src/index.js'),
},
},
stats:{
assets:false,
colors:true,
version:false,
hash:false,
timings:false,
chunks:false,
chunkModules:false,
},
debug:false,
},
plugins:[
'karma-webpack',
'karma-mocha',
'karma-coverage',
'karma-chai',
'karma-sourcemap-loader',
'karma-chrome-launcher',
'istanbul-instrumenter-loader',
'karma-coveralls',
],
reporters:['progress','coverage','coveralls'],
coverageReporter:{
dir:'test',
reporters:[{
type:'html',
subdir:'coverage',
},{
type:'text',
},{
type:'lcov',
subdir:'coverage',
}]
},
webpackMiddleware:{
noInfo:true,
},
port:9876,
colors:true,
logLevel:config.LOG_INFO,
browsers:['Chrome'],
browserNoActivityTimeout:60000,
});
};