-
-
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
feat(coverage): thresholds
to support maximum uncovered items
#7061
feat(coverage): thresholds
to support maximum uncovered items
#7061
Conversation
Match Jest's API for coverage thresholds, treating positive numbers as percentage thresholds (`lines: X` means X% of lines must be covered) and negative numbers as absolute thresholds (`lines: -X` means no more than X lines may be uncovered).
When using absolute coverage thresholds (configured using negative numbers) with the `autoUpdate` flag, set the new thresholds based on the reported number of uncovered entities. If there are no uncovered entities, set the threshold to 100%.
Remove links to Istanbul docs since those docs only talk about percentage thresholds (and they don't contain any additional information that isn't already in the vitest docs).
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
I see one test failure in CI that appears to be an unrelated test: |
thresholds
to support maximum uncovered items
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Glad to see that thresholds.autoUpdate
didn't require that much complex logic. Also test cases seem to cover all cases - nice! 💯
Left some minor improvement ideas.
Co-authored-by: Ari Perkkiö <ari.perkkio@gmail.com>
Co-authored-by: Ari Perkkiö <ari.perkkio@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Description
Closes #7056
Match Jest's API for coverage thresholds, treating a positive number as the minimum covered percentage (
lines: 90
means 90% of lines must be covered) and a negative number as the maximum uncovered count (lines: -10
means no more than 10 lines may be uncovered).When using negative coverage thresholds with the
autoUpdate
flag, set the new thresholds based on the reported number of uncovered entities. If there are no uncovered entities, set the threshold to 100%.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.