Skip to content

Istanbul Coverage + Svelte: Incorrectly Identifying an If / Else Block #1893

Closed
@kgladfelder

Description

@kgladfelder

Describe the bug

In a svelte.kit application, while outputting data in an each block, any time the iterator is accessed, Istanbul is reporting that I never go into an if block that doesn't exist. Also, in the coverage report it shows line 97 as partially covered and the HTML shows it as fully covered.

image

image

Reproduction

https://github.com/kgladfelder/vitest-issue-repro

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
    Memory: 7.88 GB / 15.86 GB
  npmPackages:
    vite: ^3.0.7 => 3.0.7
    vitest: ^0.22.0 => 0.22.0

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: coverageIssues and PRs related to the coverage featureupstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions