-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-reporters: Use global coverage thresholds as high watermarks #9416
Conversation
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.
Thanks!
Codecov Report
@@ Coverage Diff @@
## master #9416 +/- ##
=========================================
+ Coverage 64.77% 64.8% +0.02%
=========================================
Files 280 281 +1
Lines 11988 11998 +10
Branches 2957 2959 +2
=========================================
+ Hits 7765 7775 +10
Misses 3591 3591
Partials 632 632
Continue to review full report at Codecov.
|
Thank you! |
Thanks so much @Zache, I love smart ideas like this that link together existing functionality of tools! 🎉 |
@jeysal Thank you for your kind feedback. And regarding your question I don't think that would be a problem, I guess you would have my original problem in reverse but nothing should break. |
Right so based on that it looks like the custom value wouldn't matter then, it'll be red below 50%/low and green above that. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
When Istanbul generates the some reports (like html & lcov) it uses watermarks to to provide visual feedback with colors. The default watermarks are 50% and 80%. Which in the html reports means that coverage under 50% is red and coverage over 80% is green. But we have a coverage threshold of 100%, so using the report to find any file with coverage between 80% and 100% can be quite difficult as @nemoDreamer describes here: #6578.
My solution is to provide istanbul with watermarks where the high watermarks are set to the global coverage threshold of each coverage category (branches, functions, lines, and statements)
Test plan
I added unit tests for my use case and for not having any global coverage threshold and tested my changes using
yarn link