refactor: remove duplicate values from coverage.exclude#9348
refactor: remove duplicate values from coverage.exclude#9348btea wants to merge 4 commits intovitest-dev:mainfrom
coverage.exclude#9348Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
What do you mean? It is called once. |
How does your config look like? |
|
This seems more like a bug with |
|
yeah, you are right, it appears that after removing the By the way, I saw in the documentation that |
Technically speaking, the default is empty. Custom excludes don't override "the default". This is just an internal implementation detail of how the coverage providers treat certain files (like unreadable virtual files), it could've been hardcoded inside the provider, for example, but it should probably be mentioned in the docs in some way. |
I have updated the documentation. By default, vitest/packages/vitest/src/node/config/resolveConfig.ts Lines 413 to 414 in 1500654 |
|
|
||
| // Configs | ||
| resolved.config && slash(resolved.config), | ||
| resolved.config && basename(slash(resolved.config)), |
There was a problem hiding this comment.
Can you show example what cases this fixes? Does the configuration file show up in coverage in some cases?
There was a problem hiding this comment.
Does it cause issues with full path? For example, if you use vitest --config some-custom-config.ts, does that show up in coverage report?
There was a problem hiding this comment.
No, it doesn't seem to cause any problems at the moment. Actually, this PR wasn't initially intended to address this issue.
Initially, it was here: #9348 (comment). My configuration caused the configuration content to be loaded twice, resulting in duplicate content in the second load. So, I wanted to remove duplicates.
Later, with @sheremet-va's guidance #9348 (comment), I adjusted the configuration so that Vitest's configuration loading logic worked correctly, loading only once. Then I noticed that this configuration file might also be duplicated, so I tried removing duplicates there as well. Of course, I think it's probably fine not to modify this one.



Description
When
vitest --coverageis executed,resolveConfigwill be executed twice.Resolves #issue-number
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.