File tree 1 file changed +6
-2
lines changed
packages/core/testing/src
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,16 @@ import {resetFakeAsyncZone} from './fake_async';
16
16
import { TestBedImpl } from './test_bed' ;
17
17
18
18
// Reset the test providers and the fake async zone before each test.
19
- beforeEach ( getCleanupHook ( false ) ) ;
19
+ // We keep a guard because somehow this file can make it into a bundle and be executed
20
+ // beforeEach is only defined when executing the tests
21
+ globalThis . beforeEach ?.( getCleanupHook ( false ) ) ;
20
22
21
23
// We provide both a `beforeEach` and `afterEach`, because the updated behavior for
22
24
// tearing down the module is supposed to run after the test so that we can associate
23
25
// teardown errors with the correct test.
24
- afterEach ( getCleanupHook ( true ) ) ;
26
+ // We keep a guard because somehow this file can make it into a bundle and be executed
27
+ // afterEach is only defined when executing the tests
28
+ globalThis . afterEach ?.( getCleanupHook ( true ) ) ;
25
29
26
30
function getCleanupHook ( expectedTeardownValue : boolean ) {
27
31
return ( ) => {
You can’t perform that action at this time.
0 commit comments