-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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:
- Create project:
npx @angular/cli@21.0.5 new coverage-v8 - Add coverage provider:
npm i -D @vitest/coverage-v8 - Update angular.json test options:
"options": {
"coverage": true
}
- 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
Labels
No labels