This repository has been archived by the owner on Jan 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathkarma.conf.js
114 lines (108 loc) · 3.17 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* eslint no-var:0 */
var webpackConfig = require('./webpack/webpack.config.client.test.js');
module.exports = function karmaConf(config) {
var cfg = {
reporters: ['mocha', 'coverage'],
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox'],
},
},
files: ['./test/karma.bundle.js'],
frameworks: ['mocha', 'sinon-chai'],
plugins: [
'karma-coverage',
'karma-chrome-launcher',
'karma-mocha',
'karma-mocha-reporter',
'karma-sinon-chai',
'karma-sourcemap-loader',
'karma-webpack',
],
// run the bundle through the webpack and sourcemap plugins
preprocessors: {
'./test/karma.bundle.js': [ 'webpack', 'sourcemap' ],
},
// use our own webpack config to mirror test setup
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
stats: {
// With console colors
colors: true,
// add the hash of the compilation
hash: false,
// add webpack version information
version: false,
// add timing information
timings: true,
// add assets information
assets: false,
// add chunk information
chunks: false,
// add built modules information to chunk information
chunkModules: false,
// add built modules information
modules: false,
// add also information about cached (not built) modules
cached: false,
// add information about the reasons why modules are included
reasons: false,
// add the source code of modules
source: true,
// add details to errors (like resolving log)
errorDetails: true,
// add the origins of chunks and chunk merging info
chunkOrigins: true,
// Add messages from child loaders
children: false,
},
},
webpackServer: {
noInfo: true,
stats: {
// With console colors
colors: true,
// add the hash of the compilation
hash: false,
// add webpack version information
version: false,
// add timing information
timings: true,
// add assets information
assets: false,
// add chunk information
chunks: false,
// add built modules information to chunk information
chunkModules: false,
// add built modules information
modules: false,
// add also information about cached (not built) modules
cached: false,
// add information about the reasons why modules are included
reasons: false,
// add the source code of modules
source: true,
// add details to errors (like resolving log)
errorDetails: true,
// add the origins of chunks and chunk merging info
chunkOrigins: true,
// Add messages from child loaders
children: false,
},
},
coverageReporter: {
type: 'lcov',
dir: 'coverage/',
subdir: '.',
file: 'lcov.info',
},
};
if (process.env.TRAVIS) {
cfg.browsers = ['Chrome_travis_ci'];
cfg.singleRun = true;
}
config.set(cfg);
};