summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-03-05 15:39:50 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-03-05 15:39:50 +0000
commit2d99b0a0d6173dabab130117a23f2cb047a7b90a (patch)
tree6fd577ad6f0878b860d03e13020ee360d89b1170
parent26bff00d64d026ca99fbe348c239dc8060c00743 (diff)
parentb08f2407c19a0eb2c0cadbdf710ab6d56326d1d9 (diff)
downloadgitlab-ce-2d99b0a0d6173dabab130117a23f2cb047a7b90a.tar.gz
Merge branch '58390-jest-coverage-analysis-is-failing-on-master' into 'master'
Re-add babel plugins for dynamic imports Closes #58390 See merge request gitlab-org/gitlab-ce!25763
-rw-r--r--babel.config.js5
-rw-r--r--package.json1
-rw-r--r--yarn.lock7
3 files changed, 13 insertions, 0 deletions
diff --git a/babel.config.js b/babel.config.js
index e3db4dcbc9a..78d14095b0b 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -41,6 +41,11 @@ if (BABEL_ENV === 'karma' || BABEL_ENV === 'coverage') {
// Jest is running in node environment
if (BABEL_ENV === 'jest') {
plugins.push('@babel/plugin-transform-modules-commonjs');
+ /*
+ without the following, babel-plugin-istanbul throws an error:
+ https://gitlab.com/gitlab-org/gitlab-ce/issues/58390
+ */
+ plugins.push('babel-plugin-dynamic-import-node');
}
module.exports = { presets, plugins };
diff --git a/package.json b/package.json
index 86ee0de475e..cd121a5905d 100644
--- a/package.json
+++ b/package.json
@@ -134,6 +134,7 @@
"@vue/test-utils": "^1.0.0-beta.25",
"axios-mock-adapter": "^1.15.0",
"babel-jest": "^24.1.0",
+ "babel-plugin-dynamic-import-node": "^2.2.0",
"babel-plugin-istanbul": "^5.1.0",
"babel-plugin-rewire": "^1.2.0",
"chalk": "^2.4.1",
diff --git a/yarn.lock b/yarn.lock
index c045f313cff..ac39a27d659 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1454,6 +1454,13 @@ babel-loader@^8.0.5:
mkdirp "^0.5.1"
util.promisify "^1.0.0"
+babel-plugin-dynamic-import-node@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.2.0.tgz#c0adfb07d95f4a4495e9aaac6ec386c4d7c2524e"
+ integrity sha512-fP899ELUnTaBcIzmrW7nniyqqdYWrWuJUyPWHxFa/c7r7hS6KC8FscNfLlBNIoPSc55kYMGEEKjPjJGCLbE1qA==
+ dependencies:
+ object.assign "^4.1.0"
+
babel-plugin-istanbul@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.0.tgz#6892f529eff65a3e2d33d87dc5888ffa2ecd4a30"