You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems like an extra work to list all libraries which use configuration files and you still might miss some. In my case, the default config did not include postcss.config.js and tailwind.config.ts files.
Suggested solution
I would change the mentioned line to this:
'**/*.config.*'
It would be easier to maintain and I don't think that it happens usually that someone uses .config. in a file name for a file they want to test.
Alternative
Add tailwind and postcss to the list, this would resolve my use-case but not the problem in general. The code would look like this:
Thomasan1999
changed the title
Exclude all 'config.*' files from coverage by default
Exclude all '*.config.*' files from coverage by default
Sep 14, 2024
That's test file exclusions. I wonder why that's even needed - doesn't make sense to have test file extensions in configuration files. 🤔
This seems like an extra work to list all libraries which use configuration files and you still might miss some.
Yep I agree, but adding **/*.config.* could cause unexpected results. I don't think we should add pattern that's this wide.
Instead of defining your postcss.config.js and tailwind.config.ts files in coverage.exclusion, I would rather recommend to specify coverage.include so that your configuration files wouldn't match it, e.g. coverage.include: 'src'.
Clear and concise description of the problem
By default only a list of config files are excluded from coverage:
vitest/packages/vitest/src/defaults.ts
Line 18 in 5932a7f
This seems like an extra work to list all libraries which use configuration files and you still might miss some. In my case, the default config did not include
postcss.config.js
andtailwind.config.ts
files.Suggested solution
I would change the mentioned line to this:
It would be easier to maintain and I don't think that it happens usually that someone uses
.config.
in a file name for a file they want to test.Alternative
Add
tailwind
andpostcss
to the list, this would resolve my use-case but not the problem in general. The code would look like this:Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: