Skip to content

Commit 53ea04f

Browse files
committed
#15215 Fix handling of globally shared circus event handlers
1 parent c1b3d6d commit 53ea04f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/jest-circus/src/state.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ import {makeDescribe} from './utils';
1414

1515
const handlers: Array<Circus.EventHandler> = ((globalThis as Global.Global)[
1616
EVENT_HANDLERS
17-
] = ((globalThis as Global.Global)[
18-
EVENT_HANDLERS
19-
] as Array<Circus.EventHandler>) || [eventHandler, formatNodeAssertErrors]);
17+
] as Array<Circus.EventHandler>) || [eventHandler, formatNodeAssertErrors];
18+
setGlobal(globalThis, EVENT_HANDLERS, handlers, 'retain');
2019

2120
export const ROOT_DESCRIBE_BLOCK_NAME = 'ROOT_DESCRIBE_BLOCK';
2221

0 commit comments

Comments
 (0)