Skip to content

Allow project filtered test runs to report coverage of only filtered projects #6331

@stramel

Description

@stramel

Clear and concise description of the problem

Currently running vitest run --coverage --project <project_a> will result in all other projects reporting no coverage.

Suggested solution

Report only the coverage of the filtered projects when using the --project flag.

Alternative

By default, set the all flag to false if using --project (not quite the same but close)

Additional context

Getting accurate project coverage while testing in a monorepo is hard and you have to resort to npm run cover -w <project_a> which generates a coverage folder that isn't ignored by default at the project level.

Closest I have gotten is using the all:false flag which still doesn't quite do what I'm looking for

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: coverageIssues and PRs related to the coverage featurefeat: workspaceIssues and PRs related to the workspace featurep3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions