From 3a8f3d962197fbc1e6dd01580676221853e16ef4 Mon Sep 17 00:00:00 2001 From: Ian Savchenko Date: Mon, 6 May 2019 23:35:13 +0200 Subject: [PATCH 1/2] Fix babel-plugin-jest-hoist: getting full list of whitelisted globals (#8427) --- packages/babel-plugin-jest-hoist/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-plugin-jest-hoist/src/index.ts b/packages/babel-plugin-jest-hoist/src/index.ts index dd165c7363ca..6ea02185ca98 100644 --- a/packages/babel-plugin-jest-hoist/src/index.ts +++ b/packages/babel-plugin-jest-hoist/src/index.ts @@ -74,7 +74,7 @@ const WHITELISTED_IDENTIFIERS: Set = new Set([ 'require', 'undefined', ]); -Object.keys(global).forEach(name => { +Object.getOwnPropertyNames(global).forEach(name => { WHITELISTED_IDENTIFIERS.add(name); }); From f1590da349a236e185da3040aee710cac627195b Mon Sep 17 00:00:00 2001 From: Ian Savchenko Date: Mon, 6 May 2019 23:47:15 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5de00d514fa..8839e70549c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Fixes +- `[babel-plugin-jest-hoist]` Expand list of whitelisted globals in global mocks ([#8429](https://github.com/facebook/jest/pull/8429) + ### Chore & Maintenance ### Performance