Commit 01d04cc
fix: use setupTestBed() for proper Vitest TestBed reset and remove lodash
The custom initTestEnvironment() call in test-setup.shared.ts was missing
the beforeEach/afterEach cleanup hooks (ɵgetCleanupHook) that Angular
requires to reset TestBed between tests when running under Vitest.
Without these hooks, the first test in each file would instantiate TestBed
and all subsequent tests would fail with 'Cannot configure the test module
when the test module has already been instantiated'.
Switch to setupTestBed({ zoneless: true }) from
@analogjs/vitest-angular/setup-testbed which registers the correct
Vitest-native lifecycle hooks via getCleanupHook().
Also remove lodash import from weather-forecast.store.ts — lodash was
removed in #39 but this branch's version still referenced it. Replace
isEqual() with JSON.stringify comparison and isNil() with == null checks,
matching the approach used in main.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 6f481d4 commit 01d04cc
1 file changed
Lines changed: 2 additions & 19 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 4 | + | |
0 commit comments