Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Incorrect branch coverage with Vitest on Node 24 (V8 13.6) #32283

Open
@jurinmaxim

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

When defining or using Angular signals, coverage shows an uncovered branch marker at the end of the line. Likely a source-map quirk. Similar issue exists, but note: on Node 22 (V8 12.x) coverage is correct; on Node 24 (V8 13.6) phantom branches appear.

Minimal Reproduction

Steps to reproduce:

  1. Create project: npx @angular/cli@21.0.5 new coverage-v8
  2. Add coverage provider: npm i -D @vitest/coverage-v8
  3. Update angular.json test options:
"options": {
 "coverage": true
}
  1. Run tests: npm run test
    Coverage summary shows 91.66% in app.ts instead of 100%. It reports 11/12 branches covered; the uncovered branch is on the line where the signal is defined.

Note: On Node 22 (V8 12.x), this works flawlessly. The incorrect coverage appears on Node 24 (V8 13.x).

Exception or Error

Your Environment

Angular CLI : 21.0.5
Angular : 21.0.8
Node.js : 24.13.0
Package Manager : npm 11.6.2
Operating System : win32 x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.0.5 │ ^21.0.5 │
│ @angular/cli │ 21.0.5 │ ^21.0.5 │
│ @angular/common │ 21.0.8 │ ^21.0.0 │
│ @angular/compiler │ 21.0.8 │ ^21.0.0 │
│ @angular/compiler-cli │ 21.0.8 │ ^21.0.0 │
│ @angular/core │ 21.0.8 │ ^21.0.0 │
│ @angular/forms │ 21.0.8 │ ^21.0.0 │
│ @angular/platform-browser │ 21.0.8 │ ^21.0.0 │
│ @angular/router │ 21.0.8 │ ^21.0.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
│ vitest │ 4.0.17 │ ^4.0.8 │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /