Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-02-16 20:28:57 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2017-02-16 20:28:57 +0300
commitfdf0741ccc90c6f38d038c4d238db4c420e1da21 (patch)
treee06964bb6552ec35a72a76efd20d7f5d7fd370ed /config
parent0135935c80a5b984dc80659baf4ed57c61eccf9e (diff)
parent038ed9ad46ac52a7ab5f2d86f6e48b392f0fb4d9 (diff)
Merge branch 'instrument-in-karma' into 'master'
Move babel config for instanbul to karma config See merge request !9286
Diffstat (limited to 'config')
-rw-r--r--config/karma.config.js11
-rw-r--r--config/webpack.config.js1
2 files changed, 11 insertions, 1 deletions
diff --git a/config/karma.config.js b/config/karma.config.js
index 5b472780aed..2f3cc932413 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) {
var progressReporter = process.env.CI ? 'mocha' : 'progress';
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 8d981c76c1a..01c1a5bfb99 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -55,7 +55,6 @@ var config = {
exclude: /(node_modules|vendor\/assets)/,
loader: 'babel-loader',
options: {
- plugins: IS_PRODUCTION ? [] : ['istanbul'],
presets: [
["es2015", {"modules": false}],
'stage-2'