Skip to content

Add an option to collect coverage from node_modules package(s) #9241

@OSA413

Description

@OSA413

Clear and concise description of the problem

So, I want to do an extensive E2E testing for an external package I use. Currently @vitest/coverage-v8 only provides coverage for files that are in the project itself.

Suggested solution

Add an option to the Vite's test config to include and collect coverage of node_modules.

Alternative

c8 has excludeNodeModules option but it seems to only include the files to the report, but it reports incorrect files (probably because of relying on the source maps of the package)

bcoe/c8#250

Additional context

I looks like @vitest/coverage-istanbul doesn't support it neither

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    P2 - 2

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions