Skip to content

Commit 149502d

Browse files
authored
fix(babel-plugin-jest-hoist): allow using module wrapper arguments in hoisted mock factory function (#10903)
1 parent 9e93de8 commit 149502d

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
### Fixes
1414

15+
- `[babel-plugin-jest-hoist]` Add `__dirname` and `__filename` to whitelisted globals ([#10903](https://github.com/facebook/jest/pull/10903))
1516
- `[expect]` [**BREAKING**] Revise `expect.not.objectContaining()` to be the inverse of `expect.objectContaining()`, as documented. ([#10708](https://github.com/facebook/jest/pull/10708))
1617
- `[jest-circus]` Fixed the issue of beforeAll & afterAll hooks getting executed even if it is inside a skipped `describe` block [#10451](https://github.com/facebook/jest/issues/10451)
1718
- `[jest-circus]` Fix `testLocation` on Windows when using `test.each` ([#10871](https://github.com/facebook/jest/pull/10871))

packages/babel-plugin-jest-hoist/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ const ALLOWED_IDENTIFIERS = new Set<string>(
8585
'jest',
8686
'parseFloat',
8787
'parseInt',
88+
'exports',
8889
'require',
90+
'module',
91+
'__filename',
92+
'__dirname',
8993
'undefined',
9094
...Object.getOwnPropertyNames(global),
9195
].sort(),

0 commit comments

Comments
 (0)