File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/core/testing/src Expand file tree Collapse file tree 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';
1616import { TestBedImpl } from './test_bed' ;
1717
1818// 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 ) ) ;
2022
2123// We provide both a `beforeEach` and `afterEach`, because the updated behavior for
2224// tearing down the module is supposed to run after the test so that we can associate
2325// 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 ) ) ;
2529
2630function getCleanupHook ( expectedTeardownValue : boolean ) {
2731 return ( ) => {
You can’t perform that action at this time.
0 commit comments