diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-04-25 15:38:15 +0200 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-04-25 15:38:15 +0200 |
commit | 9062b9a5d5e564917decbe3c0691e1f1de430a29 (patch) | |
tree | eb8482e5e33631f5dd6a4fb3bd7d77f01e5ed366 /babel.config.js | |
parent | 8a07d5e60faffcdf090376a1957be8703253e7ce (diff) | |
download | gitlab-ce-9062b9a5d5e564917decbe3c0691e1f1de430a29.tar.gz |
Remove babel environment for Jest
Diffstat (limited to 'babel.config.js')
-rw-r--r-- | babel.config.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/babel.config.js b/babel.config.js index 78d14095b0b..df30892731d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -38,8 +38,9 @@ if (BABEL_ENV === 'karma' || BABEL_ENV === 'coverage') { plugins.push('babel-plugin-rewire'); } -// Jest is running in node environment -if (BABEL_ENV === 'jest') { +// Jest is running in node environment, so we need additional plugins +const isJest = !!process.env.JEST_WORKER_ID; +if (isJest) { plugins.push('@babel/plugin-transform-modules-commonjs'); /* without the following, babel-plugin-istanbul throws an error: |