Commit d097df2
committed
fix(@angular/build): correct Vitest coverage path resolution for JSDOM on Windows
This commit addresses an issue where Vitest coverage reports were incomplete on Windows when using the JSDOM test environment. The root cause is an improperly formatted absolute path that can result from manually converting a file URL back to a path on Windows, leading to a superfluous leading slash (e.g., '/D:/path' instead of 'D:/path').
The 'angular:test-in-memory-provider' plugin now explicitly detects and removes this leading slash from absolute Windows paths, thereby correcting the path format and enabling proper source file mapping for coverage collection.
(cherry picked from commit 3020b50)1 parent c568c0d commit d097df2Copy full SHA for d097df2
File tree
Expand file treeCollapse file tree
2 files changed
+33
-10
lines changedOpen diff view settings
Filter options
- packages/angular/build/src/builders/unit-test/runners/vitest
- tests/legacy-cli/e2e/tests/vitest
Expand file treeCollapse file tree
2 files changed
+33
-10
lines changedOpen diff view settings
Collapse file
packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts
Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts+27Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
| 12 | + |
12 | 13 | |
13 | 14 | |
14 | 15 | |
| ||
173 | 174 | |
174 | 175 | |
175 | 176 | |
| 177 | + |
176 | 178 | |
177 | 179 | |
178 | 180 | |
| ||
184 | 186 | |
185 | 187 | |
186 | 188 | |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
187 | 214 | |
188 | 215 | |
189 | 216 | |
|
Collapse file
tests/legacy-cli/e2e/tests/vitest/larger-project-coverage.ts
Copy file name to clipboardExpand all lines: tests/legacy-cli/e2e/tests/vitest/larger-project-coverage.ts+6-10Lines changed: 6 additions & 10 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
49 | 45 | |
50 | 46 | |
51 | 47 | |
|
0 commit comments