10000 Vitest code coverage not properly reported · Issue #30333 · angular/angular-cli · GitHub
[go: up one dir, main page]

Skip to content

Vitest code coverage not properly reported #30333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
json-derulo opened this issue May 16, 2025 · 0 comments · Fixed by #30343
Closed
1 task

Vitest code coverage not properly reported #30333

json-derulo opened this issue May 16, 2025 · 0 comments · Fixed by #30343

Comments

@json-derulo
Copy link
json-derulo commented May 16, 2025

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

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:

Image

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

  1. 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
  2. Run ng test --code-coverage
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0