-
Notifications
You must be signed in to change notification settings - Fork 5
/
karma-coverage.conf.js
65 lines (56 loc) · 1.73 KB
/
karma-coverage.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
/* global module */
module.exports = function (config) {
'use strict';
config.set({
autoWatch: false,
singleRun: true,
frameworks: ['jspm', 'jasmine'],
files: [
'node_modules/karma-babel-preprocessor/node_modules/babel-core/browser-polyfill.js',
{pattern: 'app/assets/images/**/*.png', watched: false, included: false, served: true},
],
jspm: {
config: 'app/jspm-config/config-karma.js',
loadFiles: [
'build/coverage/js/**/*.js'
]
},
browsers: ['PhantomJS'],
preprocessors: {
'build/coverage/js/**/!(*spec).js': [ 'babel', 'sourcemap', 'coverage']
},
babelPreprocessor: {
options: {
sourceMap: 'inline',
blacklist: ['useStrict']
},
sourceFileName: function(file) {
return file.originalPath;
}
},
proxies: {
'/assets/images/': '/base/app/assets/images/'
},
reporters: ['coverage', 'dots'],
coverageReporter: {
instrumenters: {isparta: require('isparta')},
instrumenter: {
'build/test/js/**/*.js': 'isparta'
},
reporters: [
{
type: 'text-summary',
subdir: normalizationBrowserName
},
{
type: 'html',
dir: 'coverage/',
subdir: normalizationBrowserName
}
]
}
});
function normalizationBrowserName(browser) {
return browser.toLowerCase().split(/[ /-]/)[0];
}
};