Commit 1d296be
committed
fix(@angular/build): ensure test hooks are registered in non-headless browser mode
This commit moves the `beforeEach` and `afterEach` hook registrations for TestBed cleanup to be outside the global setup guard.
In non-headless browser environments, the setup file can be executed in different contexts where the global guard prevents the hooks from being registered, leading to inconsistent test behavior. This change ensures the cleanup hooks are always registered, improving reliability for headed browser test execution.
Due to the nature of the issue, which only manifests in headed browser mode, automated testing in a CI environment is problematic.1 parent 5e78117 commit 1d296be
File tree
1 file changed
+7
-4
lines changed- packages/angular/build/src/builders/unit-test/runners/vitest
1 file changed
+7
-4
lines changedLines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
0 commit comments