diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-09-11 21:03:05 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-09-11 21:03:05 +0000 |
commit | 01b669640ab02a9f3eb45d74396b27e1a4fa165d (patch) | |
tree | 56c10cb571b49754972f584a80189b6c6696a9e2 /config | |
parent | 9b0764938315dd581cf38d8589f6811dc63b26a8 (diff) | |
download | gitlab-ce-01b669640ab02a9f3eb45d74396b27e1a4fa165d.tar.gz |
Generate JUnit report for Karma tests
Diffstat (limited to 'config')
-rw-r--r-- | config/karma.config.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/config/karma.config.js b/config/karma.config.js index 84810332dc2..c890c670619 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -80,11 +80,12 @@ if (specFilters.length) { module.exports = function(config) { process.env.TZ = 'Etc/UTC'; - const progressReporter = process.env.CI ? 'mocha' : 'progress'; - const karmaConfig = { basePath: ROOT_PATH, browsers: ['ChromeHeadlessCustom'], + client: { + isCI: !!process.env.CI + }, customLaunchers: { ChromeHeadlessCustom: { base: 'ChromeHeadless', @@ -104,11 +105,19 @@ module.exports = function(config) { preprocessors: { 'spec/javascripts/**/*.js': ['webpack', 'sourcemap'], }, - reporters: [progressReporter], + reporters: ['progress'], webpack: webpackConfig, webpackMiddleware: { stats: 'errors-only' }, }; + if (process.env.CI) { + karmaConfig.reporters = ['mocha', 'junit']; + karmaConfig.junitReporter = { + outputFile: 'junit_karma.xml', + useBrowserName: false, + }; + } + if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') { karmaConfig.reporters.push('coverage-istanbul'); karmaConfig.coverageIstanbulReporter = { |