forked from commenthol/debug-level
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
80 lines (66 loc) · 1.83 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
const karmaTestMiddleware = require('./test/helpers/karma-test-middleware.js')
// Reference: http://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function karmaConfig (config) {
config.set({
browsers: [
// 'Firefox',
'Chrome'
// 'ChromeHeadless'
],
singleRun: true,
autoWatch: true,
frameworks: [
// Reference: https://github.com/karma-runner/karma-mocha
// Set framework to mocha
'mocha'
],
reporters: ['progress', 'coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['text', 'html'],
fixWebpackSourcePaths: true
},
files: [
// Grab all files in the tests directory that contain _test.
'test/browser.test.js',
'test/Format.test.js',
'test/utils.test.js'
],
preprocessors: {
// Reference: http://webpack.github.io/docs/testing.html
// Reference: https://github.com/webpack/karma-webpack
// Convert files with webpack and load sourcemaps
'test/*.test.js': ['webpack', 'sourcemap']
},
// Configure code coverage reporter
coverageReporter: {
reporters: [
{ type: 'html', dir: 'coverage/' },
{ type: 'text' }
]
},
client: {
mocha: {
reporter: 'html',
opts: './test/mocha.opts'
}
},
middleware: ['test'],
plugins: [
'karma-mocha',
'karma-webpack',
'karma-spec-reporter',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-sourcemap-loader',
'karma-coverage',
'karma-coverage-istanbul-reporter',
{ 'middleware:test': ['factory', karmaTestMiddleware] }
],
// Test webpack config
webpack: require('./webpack.config'),
// Hide webpack build information from output
webpackMiddleware: {
noInfo: true
}
})
}