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); });