From 1ab41c3eabc0b14fe4afa8a9b29c4907409144a7 Mon Sep 17 00:00:00 2001 From: Christian Gonzalez Date: Sat, 3 Mar 2018 00:37:16 -0800 Subject: [PATCH] Set compact to false to avoid Babel warnings on large files (Fixes #5703) (#5704) * Set compact false for babel * Push changelog update * Add compact flag to babel-jest as well, fix lint errors * Be consistent and set compact to false in both places --- CHANGELOG.md | 2 ++ packages/babel-jest/src/index.js | 1 + packages/jest-runtime/src/script_transformer.js | 1 + 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd0076cb3b8f..43854874a7c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ ([#5696](https://github.com/facebook/jest/pull/5696)) * `[expect]` Fix rejects.not matcher ([#5670](https://github.com/facebook/jest/pull/5670)) +* `[jest-runtime]` Prevent Babel warnings on large files + ([#5702](https://github.com/facebook/jest/pull/5702)) ### Chore & Maintenance diff --git a/packages/babel-jest/src/index.js b/packages/babel-jest/src/index.js index 34ea2f1d2886..223ce85a56f9 100644 --- a/packages/babel-jest/src/index.js +++ b/packages/babel-jest/src/index.js @@ -72,6 +72,7 @@ const createTransformer = (options: any): Transformer => { }; options = Object.assign({}, options, { + compact: false, plugins: (options && options.plugins) || [], presets: ((options && options.presets) || []).concat([jestPreset]), sourceMaps: 'both', diff --git a/packages/jest-runtime/src/script_transformer.js b/packages/jest-runtime/src/script_transformer.js index cdddfb5b531f..0f5890e55934 100644 --- a/packages/jest-runtime/src/script_transformer.js +++ b/packages/jest-runtime/src/script_transformer.js @@ -158,6 +158,7 @@ export default class ScriptTransformer { [ babelPluginIstanbul, { + compact: false, // files outside `cwd` will not be instrumented cwd: this._config.rootDir, exclude: [],