Bring back coverage reporting

This commit is contained in:
Marc Jansen
2017-08-19 18:07:11 +02:00
parent f36c557aca
commit 53214f6ae1
2 changed files with 34 additions and 2 deletions

View File

@@ -68,6 +68,7 @@
"jquery": "3.2.1", "jquery": "3.2.1",
"jscodeshift": "^0.3.30", "jscodeshift": "^0.3.30",
"karma": "^1.7.0", "karma": "^1.7.0",
"karma-coverage": "^1.1.1",
"karma-chrome-launcher": "^2.1.1", "karma-chrome-launcher": "^2.1.1",
"karma-firefox-launcher": "^1.0.1", "karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0", "karma-mocha": "^1.3.0",

View File

@@ -49,6 +49,25 @@ module.exports = function(karma) {
proxies: { proxies: {
'/rendering/': '/base/rendering/', '/rendering/': '/base/rendering/',
'/spec/': '/base/spec/' '/spec/': '/base/spec/'
},
preprocessors: {
// source files, that you wanna generate coverage for
// do not include tests or libraries
// (these files will be instrumented by Istanbul)
'../src/**/*.js': ['coverage']
},
reporters: ['coverage'],
coverageReporter: {
reporters: [
{
type: 'lcov', // produces HTML output and lcov
dir: '../coverage/',
subdir: '.'
},
{
type: 'text-summary' // prints the textual summary to the terminal
}
]
} }
}); });
@@ -91,11 +110,23 @@ module.exports = function(karma) {
username: 'openlayers', username: 'openlayers',
accessKey: process.env.SAUCE_ACCESS_KEY accessKey: process.env.SAUCE_ACCESS_KEY
}, },
reporters: ['dots', 'saucelabs'], reporters: ['dots', 'saucelabs', 'coverage'],
captureTimeout: 240000, captureTimeout: 240000,
browserNoActivityTimeout: 240000, browserNoActivityTimeout: 240000,
customLaunchers: customLaunchers, customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers) browsers: Object.keys(customLaunchers),
coverageReporter: {
reporters: [
{
type: 'lcovonly', // that's enough for coveralls, no HTML
dir: '../coverage/',
subdir: '.'
},
{
type: 'text-summary' // prints the textual summary to the terminal
}
]
}
}); });
} else { } else {
karma.set({ karma.set({