-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.config.js
101 lines (84 loc) · 2.08 KB
/
karma.config.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
/** Reference: http://karma-runner.github.io/0.12/config/configuration-file.html */
module.exports = function karmaConfig (config) {
config.set({
plugins: [
require('karma-webpack'),
require('karma-sourcemap-loader'),
require('karma-mocha'),
require('karma-mocha-reporter'),
require('karma-nyan-reporter'),
require('karma-threshold-reporter'),
require('karma-coverage'),
require('karma-phantomjs-launcher')
],
logLevel: config.LOG_DEBUG, /** Log our errors */
client: {
captureConsole: true
},
frameworks: [
/**
* Reference: https://github.com/karma-runner/karma-jasmine
* Set framework to jasmine
*/
'mocha'
],
// reporters: [
// /**
// * Reference: https://github.com/mlex/karma-spec-reporter
// * Set reporter to print detailed results to console
// */
// 'progress',
// /**
// * Reference: https://github.com/karma-runner/karma-coverage
// * Output code coverage files
// */
// 'coverage'
// ],
reporters: [ 'mocha' ],
files: [
/** Grab all files in the app folder that contain .spec. */
'./src/tests.webpack.js'
/** each file acts as entry point for the webpack configuration */
],
preprocessors: {
/**
* Reference: http://webpack.github.io/docs/testing.html
* Reference: https://github.com/webpack/karma-webpack
* Convert files with webpack and load sourcemaps
*/
'./src/tests.webpack.js': ['webpack', 'sourcemap']
},
browsers: ['PhantomJS'],
singleRun: false,
/** Configure code coverage reporter */
coverageReporter: {
dir: 'coverage',
reporters: [
{type: 'html', subdir: 'html'}
],
check: {
statements: 50,
branches: 50,
functions: 50,
lines: 50
},
watermarks: {
statements: [30, 50],
functions: [30, 50],
branches: [30, 50],
lines: [30, 50]
}
},
thresholdReporter: {
statements: 50,
branches: 50,
functions: 50,
lines: 50
},
webpack: require('./webpack.config'),
/** Hide webpack build information from output */
webpackMiddleware: {
noInfo: 'errors-only'
}
});
};