diff options
author | winniehell <git@winniehell.de> | 2017-02-15 23:39:45 +0100 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2017-02-16 10:12:32 +0100 |
commit | 038ed9ad46ac52a7ab5f2d86f6e48b392f0fb4d9 (patch) | |
tree | edec5ef6c22fc92670d81c8f889b53ce1574aef8 /config/karma.config.js | |
parent | 5ad1d40c7f2858a06a7af9ea68a5d9531d936cc9 (diff) | |
download | gitlab-ce-038ed9ad46ac52a7ab5f2d86f6e48b392f0fb4d9.tar.gz |
Move babel config for instanbul to karma config (!9286)
Diffstat (limited to 'config/karma.config.js')
-rw-r--r-- | config/karma.config.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/config/karma.config.js b/config/karma.config.js index a1fbeab1f46..a16e2d2077f 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -2,6 +2,17 @@ var path = require('path'); var webpackConfig = require('./webpack.config.js'); var ROOT_PATH = path.resolve(__dirname, '..'); +// add coverage instrumentation to babel config +if (webpackConfig && webpackConfig.module && webpackConfig.module.rules) { + var babelConfig = webpackConfig.module.rules.find(function (rule) { + return rule.loader === 'babel-loader'; + }); + + babelConfig.options = babelConfig.options || {}; + babelConfig.options.plugins = babelConfig.options.plugins || []; + babelConfig.options.plugins.push('istanbul'); +} + // Karma configuration module.exports = function(config) { config.set({ |