GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Vitest: Coverage reporter flagging parenthesis and TS type as uncovered branches · Issue #32718 · angular/angular-cli

Vitest: Coverage reporter flagging parenthesis and TS type as uncovered branches #32718

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
Vitest: Coverage reporter flagging parenthesis and TS type as uncovered branches#32718
Copy link
Labels
angular/build:unit-testarea: @angular/buildgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini

Description

@ChrisMBarr
ChrisMBarr
opened on Mar 6, 2026
Issue body actions

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 in the process of migrating unit tests from Jasmine to Vitest and I noticed that the code coverage percentages are all being thrown off when using Vitest, which did not happen before with Jasmine.

When I run my tests with coverage, the generated report is flagging things like a closing parentheses or a typescript type as an uncovered code branch. This is happening to me when I use either the v8 or istanbul reporter, it seems to make no difference.

I originally opened an issue with Vitest, but they suggested I open one here

Minimal Reproduction

https://stackblitz.com/edit/angular-eslint-repros-pf1h8ams?file=src%2Fmain.ts,src%2Fapp.component.spec.ts

Exception or Error

  • Follow above link
  • run npm run test
  • Open the code coverage for main.ts
  • You will see lines 16 and 17 show uncovered code branches, which affects the coverage percentage. Obviously this is wrong and I would not expect this to happen
Image

Your Environment

Angular CLI       : 21.2.1
Angular           : 21.2.1
Node.js           : 24.12.0
Package Manager   : npm 11.8.0
Operating System  : win32 x64

┌───────────────────────────────────┬───────────────────┬───────────────────┐
│ Package                           │ Installed Version │ Requested Version │
├───────────────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations               │ 21.2.1            │ ^21.2.1           │
│ @angular/build                    │ 21.2.1            │ ^21.2.1           │
│ @angular/cdk                      │ 21.2.1            │ ~21.2.1           │
│ @angular/cli                      │ 21.2.1            │ ^21.2.1           │
│ @angular/common                   │ 21.2.1            │ ^21.2.1           │
│ @angular/compiler                 │ 21.2.1            │ ^21.2.1           │
│ @angular/compiler-cli             │ 21.2.1            │ ^21.2.1           │
│ @angular/core                     │ 21.2.1            │ ^21.2.1           │
│ @angular/forms                    │ 21.2.1            │ ^21.2.1           │
│ @angular/localize                 │ 21.2.1            │ ^21.2.1           │
│ @angular/platform-browser         │ 21.2.1            │ ^21.2.1           │
│ @angular/platform-browser-dynamic │ 21.2.1            │ ^21.2.1           │
│ @angular/router                   │ 21.2.1            │ ^21.2.1           │
│ vitest                            │ 4.0.18            │ ^4.0.18           │
│ zone.js                           │ 0.16.1            │ ~0.16.1           │
└───────────────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Reacted by nlackie

Activity

  1. angular-robot
    added
    area: @angular/cli
    gemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini
    on Mar 6, 2026
  2. alan-agius4
    added
    area: @angular/build
    angular/build:unit-test
    and removed
    area: @angular/cli
    on Mar 6, 2026
  3. clydin
    closed this as a duplicateof Inaccurate code coverage with aot testing angular#64583 on Mar 9, 2026
  4. ChrisMBarr commented on Mar 9, 2026

    @ChrisMBarr
    ChrisMBarr
    on Mar 9, 2026
    Author
    More actions

    As a follow up: updating to 21.2.2 has fixed this issue

    Reacted by Alan Agius
  5. angular-automatic-lock-bot commented on Apr 9, 2026

    @angular-automatic-lock-bot
    angular-automatic-lock-botBot
    on Apr 9, 2026
    More actions

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. angular-automatic-lock-bot
    locked and limited conversation to collaborators on Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    angular/build:unit-testarea: @angular/buildgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.