-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
refactor: remove duplicate values from coverage.exclude
#9348
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |
| import { getWorkersCountByPercentage } from '../../utils/workers' | ||
| import { BaseSequencer } from '../sequencers/BaseSequencer' | ||
| import { RandomSequencer } from '../sequencers/RandomSequencer' | ||
| import { basename } from 'node:path' | ||
|
|
||
| function resolvePath(path: string, root: string) { | ||
| return normalize( | ||
|
|
@@ -394,7 +395,7 @@ | |
|
|
||
| // Add hard-coded default coverage exclusions. These cannot be overidden by user config. | ||
| // Override original exclude array for cases where user re-uses same object in test.exclude. | ||
| resolved.coverage.exclude = [ | ||
| resolved.coverage.exclude = [...new Set([ | ||
| ...resolved.coverage.exclude, | ||
|
|
||
| // Exclude setup files | ||
|
|
@@ -410,15 +411,15 @@ | |
| ...resolved.include, | ||
|
|
||
| // Configs | ||
| resolved.config && slash(resolved.config), | ||
| resolved.config && basename(slash(resolved.config)), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you show example what cases this fixes? Does the configuration file show up in coverage in some cases?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it cause issues with full path? For example, if you use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| ...configFiles, | ||
|
|
||
| // Vite internal | ||
| '**\/virtual:*', | ||
| '**\/__x00__*', | ||
|
|
||
| '**/node_modules/**', | ||
| ].filter(pattern => typeof pattern === 'string') | ||
| ])].filter(pattern => typeof pattern === 'string') | ||
|
|
||
| resolved.forceRerunTriggers = [ | ||
| ...resolved.forceRerunTriggers, | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.