From aca486187c50a205984b5c5871724038c1237ab0 Mon Sep 17 00:00:00 2001 From: Ian Savchenko <4881952+IanSavchenko@users.noreply.github.com> Date: Tue, 7 May 2019 09:21:31 +0200 Subject: [PATCH] fix(babel-plugin-jest-hoist): getting full list of whitelisted globals for node 12 (#8429) --- CHANGELOG.md | 2 ++ packages/babel-plugin-jest-hoist/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 429bac3b72b1..460ec7669bbd 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 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); });