Skip to content

This plugin breaks vitest coverage report #4

@Sec-ant

Description

@Sec-ant

When using this plugin and adding // #v-ifdef DEV and // #v-endif comments in my code, vitest marks all code as 100% covered (istanbul).

image

If I remove the directives, the coverage works again:

image

Similar issues can be found at:

  1. Vite plugin breaks vitest coverage report unplugin-vue-components#333
  2. this plugin destroy sourcemap. unplugin-vue-components#219 (maybe related, this is referred to in the previous link)

This should be easily reproducible.

Here is a minimal reproduction: https://stackblitz.com/edit/vitest-dev-vitest-4tlh7n?file=src%2Findex.ts

Is there a workaround to solve this problem?

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