-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage on workspace includes node_modules despite exclusions #7203
Comments
The workaround I found was to add this setting to the configuration.
|
@nickm-oua Hmm, I tried this with both v8 & istanbul, but I'm still seeing the same result where files in |
You probably need a root
|
Hello @mhuggins. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with |
Thanks @hi-ogawa, that helped me to get it working! All I needed to do was:
|
Describe the bug
I've got a pnpm workspace with packages under
apps/*
andpackages/*
. Specifically, one package in each sub-folder has avitest.config.ts
file, containing the following:I've tried multiple iterations of defining a
vitest.workspace.ts
file in my project root.Most basic approach:
Most complex approach:
When running
vitest run --coverage
, the correct limited set of tests are being run. However, the code coverage is a very large dump, including coverage of files found innode_modules
within each of the individual package folders.Am I doing something wrong with my configuration? I would not expect
node_modules
to be included by default or with it being explicitly excluded.Reproduction
Create a pnpm workspace with a
pnpm-workspace.yaml
file:Create a package under each of these folders, and define vitest configs as outlined previously.
Run
vitest run --coverage
.System Info
The text was updated successfully, but these errors were encountered: