Merge branch 'winh-jest-ide' into 'master'

Remove babel environment for Jest

Closes #59164

See merge request gitlab-org/gitlab-ce!27676
This commit is contained in:
Phil Hughes 2019-05-01 07:41:28 +00:00
commit e7c4ca86d9
2 changed files with 4 additions and 4 deletions

View file

@ -38,8 +38,9 @@ if (BABEL_ENV === 'karma' || BABEL_ENV === 'coverage') {
plugins.push('babel-plugin-rewire'); plugins.push('babel-plugin-rewire');
} }
// Jest is running in node environment // Jest is running in node environment, so we need additional plugins
if (BABEL_ENV === 'jest') { const isJest = !!process.env.JEST_WORKER_ID;
if (isJest) {
plugins.push('@babel/plugin-transform-modules-commonjs'); plugins.push('@babel/plugin-transform-modules-commonjs');
/* /*
without the following, babel-plugin-istanbul throws an error: without the following, babel-plugin-istanbul throws an error:

View file

@ -6,8 +6,7 @@
"eslint": "eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.vue .", "eslint": "eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.vue .",
"eslint-fix": "eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.vue --fix .", "eslint-fix": "eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.vue --fix .",
"eslint-report": "eslint --max-warnings 0 --ext .js,.vue --format html --output-file ./eslint-report.html --no-inline-config .", "eslint-report": "eslint --max-warnings 0 --ext .js,.vue --format html --output-file ./eslint-report.html --no-inline-config .",
"jest": "BABEL_ENV=jest jest", "jest-debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
"jest-debug": "BABEL_ENV=jest node --inspect-brk node_modules/.bin/jest --runInBand",
"jsdoc": "jsdoc -c config/jsdocs.config.js", "jsdoc": "jsdoc -c config/jsdocs.config.js",
"karma": "BABEL_ENV=${BABEL_ENV:=karma} karma start --single-run true config/karma.config.js", "karma": "BABEL_ENV=${BABEL_ENV:=karma} karma start --single-run true config/karma.config.js",
"karma-coverage": "BABEL_ENV=coverage karma start --single-run true config/karma.config.js", "karma-coverage": "BABEL_ENV=coverage karma start --single-run true config/karma.config.js",