Open
Description
Command
test
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
In the "This experimental unit testing" mode, when using coverage, the HTML coverage report does not display properly.
Minimal Reproduction
Steps:
-
Install Angular 20
-
Enable Vitest: https://angular.dev/guide/testing/unit-tests#
-
Run: ng test --code-coverage
-
In the auto-generated folder: dist/test-out/[path]/coverage/index.html
Exception or Error
Unable to lookup source: /home/projects/angular/a20-vitest/dist/test-out/b3051492-863d-46fc-bc29-87425336cca6/src/app/app.ts (ENOENT: no such file or directory, open '/home/projects/angular/a20-vitest/dist/test-out/b3051492-863d-46fc-bc29-87425336cca6/src/app/app.ts')
Error: Unable to lookup source: /home/projects/angular/a20-vitest/dist/test-out/b3051492-863d-46fc-bc29-87425336cca6/src/app/app.ts (ENOENT: no such file or directory, open '/home/projects/angular/a20-vitest/dist/test-out/b3051492-863d-46fc-bc29-87425336cca6/src/app/app.ts')
at Context.defaultSourceLookup [as sourceFinder] (/home/projects/angular/a20-vitest/node_modules/istanbul-lib-report/lib/context.js:17:15)
at Context.getSource (/home/projects/angular/a20-vitest/node_modules/istanbul-lib-report/lib/context.js:71:21)
at annotateSourceCode (/home/projects/angular/a20-vitest/node_modules/istanbul-reports/lib/html/annotator.js:249:40)
at HtmlReport.onDetail (/home/projects/angular/a20-vitest/node_modules/istanbul-reports/lib/html/index.js:414:33)
at Visitor.value (/home/projects/angular/a20-vitest/node_modules/istanbul-lib-report/lib/tree.js:38:38)
at ReportNode.visit (/home/projects/angular/a20-vitest/node_modules/istanbul-lib-report/lib/tree.js:88:21)
at /home/projects/angular/a20-vitest/node_modules/istanbul-lib-report/lib/tree.js:92:19
at Array.forEach ()
at ReportNode.visit (/home/projects/angular/a20-vitest/node_modules/istanbul-lib-report/lib/tree.js:91:28)
at ReportTree.visit (/home/projects/angular/a20-vitest/node_modules/istanbul-lib-report/lib/tree.js:127:24)
Your Environment
Angular CLI: 20.0.1
Node: 22.16.0
Package Manager: npm 10.9.2
OS: linux x64
Anything else relevant?
No response