diff options
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 = { |