-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
78 lines (64 loc) · 1.64 KB
/
karma.conf.js
File metadata and controls
78 lines (64 loc) · 1.64 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
const config = require('./webpack.config.js');
const path = require('path');
const webpack = Object.assign({}, config);
webpack.module.rules.push({
enforce: 'post',
test: /.*.jsx|(^(?!.*spec).*.js)/,
exclude: /(node_modules|test)/,
loader: 'istanbul-instrumenter-loader'
});
delete webpack.entry;
module.exports = function(config) {
config.set({
browsers: ['PhantomJS'],
client: {
mocha: {
ui: 'bdd-lazy-var/global',
require: [require.resolve('bdd-lazy-var/global')]
},
},
frameworks: ['mocha'],
files: [
'node_modules/whatwg-fetch/fetch.js',
'node_modules/babel-polyfill/dist/polyfill.js',
'client/test.js'
],
reporters: ['mocha', 'coverage-istanbul'],
coverageReporter: {
dir: 'build/coverage/',
reporters: [
{ type: 'html' },
{ type: 'text' },
{ type: 'text-summary' },
]
},
coverageIstanbulReporter: {
fixWebpackSourcePaths: true,
reports: ['html', 'text-summary' ],
// the option below would be nice, but it doesn't work.
// See http://bit.ly/2qMKkS5
// includeAllSources: true,
},
mochaReporter: {
showDiff: true,
},
preprocessors: {
'client/test.js': ['webpack', 'sourcemap']
},
webpack: webpack,
webpackMiddleware: {
noInfo: true,
stats: {
chunks: false
}
},
plugins: [
require('karma-mocha'),
require('karma-webpack'),
require('karma-mocha-reporter'),
require('karma-phantomjs-launcher'),
require('karma-sourcemap-loader'),
require('karma-coverage-istanbul-reporter')
]
});
};