fix: show a better message when coverage is really close to min coverage#1084
Merged
alestiago merged 2 commits intoVeryGoodOpenSource:mainfrom Jul 26, 2024
Merged
Conversation
wolfenrain
reviewed
Jul 16, 2024
| ).called(1); | ||
| verify( | ||
| () => logger.err( | ||
| 'Expected coverage >= 100.000000% but actual is 99.999995%.', |
Contributor
There was a problem hiding this comment.
I would still prefer the 100 to stay the same (100.00%), the actual is where the decimal point matters.
Contributor
Author
There was a problem hiding this comment.
I did this because there could be a case where someone has min coverage going to more than two decimal places, like 99.004. In that case, if the coverage was 99.003, then the message would be Expected coverage >= 99.00% but actual is 99.003%.
Obviously it's an edge case, but I don't think we should round either value if it could make the error messaging more confusing. Plus, in most cases the coverage won't be that close and it will display 100.00% anyway.
alestiago
approved these changes
Jul 24, 2024
wolfenrain
approved these changes
Jul 24, 2024
matiasleyba
pushed a commit
to a-wallen/very_good_cli
that referenced
this pull request
Jul 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
READY
Description
On our project we had one line uncovered, which gave us a coverage of 99.995%. Our minimum coverage is 100%. The message given was
Expected coverage >= 100.00% but actual is 100.00%, which isn't very helpful. This change will still use 2 decimal places unless the actual coverage is so close that it rounds to the expected amount, and in that case will increase to an appropriate number of decimal places.Type of Change