Skip to content

Commit

Permalink
Test hooks should receive group context if there is no test context
Browse files Browse the repository at this point in the history
  Allows test.concurrent to function without beforeEach
  known issue at jestjs/jest#7997
  • Loading branch information
ianpurvis committed Mar 30, 2023
1 parent 0dcc307 commit dd0b3b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function adaptDescribeEachHook(hook, beforeAllHook, afterAllHook) {
function adaptTestHook(hook) {
return (name, fn, timeout) => (
hook(name, async (...args) => {
await fn(testContext, ...args)
await fn(testContext || groupContext, ...args)
}, timeout)
)
}
Expand Down

0 comments on commit dd0b3b1

Please sign in to comment.