Command
test
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I am trying out the new experimental vitest builder, which works great for me in general! I just found an issue with the coverage reporting. After installing @vitest/coverage-v8 and running ng test --code-coverage with the vitest builder, the coverage is not properly reported. The displayed coverage table appears empty:
The XML, JSON and HTML reports located in dist/test-out/**/coverage are also empty. As there is actually something tested in app.ts, I would have expected something to appear in the coverage report.
Minimal Reproduction
- Generate a fresh project with
npx@angular/cli@next new and switch to the unit-test builder, or check out the code from the reproduction repo: https://github.com/json-derulo/ng20-vitest
- Run
ng test --code-coverage
- Take a look at the console output
Exception or Error
No exception or error visible, but the coverage is not reported
Your Environment
Angular CLI: 20.0.0-rc.2
Node: 22.15.1
Package Manager: pnpm 9.15.6
OS: darwin x64
Angular: 20.0.0-rc.1
... common, compiler, compiler-cli, core, forms
... platform-browser, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.2000.0-rc.2 (cli-only)
@angular-devkit/core 20.0.0-rc.2 (cli-only)
@angular-devkit/schematics 20.0.0-rc.2 (cli-only)
@angular/build 20.0.0-rc.2
@angular/cli 20.0.0-rc.2
@schematics/angular 20.0.0-rc.2 (cli-only)
rxjs 7.8.2
typescript 5.8.3
Anything else relevant?
I also tried to configure the development configuration as the build target for the unit tests, but the same thing happens.
Command
test
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I am trying out the new experimental vitest builder, which works great for me in general! I just found an issue with the coverage reporting. After installing
@vitest/coverage-v8and runningng test --code-coveragewith the vitest builder, the coverage is not properly reported. The displayed coverage table appears empty:The XML, JSON and HTML reports located in
dist/test-out/**/coverageare also empty. As there is actually something tested inapp.ts, I would have expected something to appear in the coverage report.Minimal Reproduction
npx@angular/cli@next newand switch to the unit-test builder, or check out the code from the reproduction repo: https://github.com/json-derulo/ng20-vitestng test --code-coverageException or Error
Your Environment
Anything else relevant?
I also tried to configure the
developmentconfiguration as the build target for the unit tests, but the same thing happens.