Vitest code coverage not properly reported #30333
Labels
angular/build:unit-test
area: @angular/build
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
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 runningng 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 inapp.ts
, I would have expected something to appear in the coverage report.Minimal Reproduction
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-vitestng test --code-coverage
Exception or Error
Your Environment
Anything else relevant?
I also tried to configure the
development
configuration as the build target for the unit tests, but the same thing happens.The text was updated successfully, but these errors were encountered: