chore: improving code coverage to 100% branches#1624
chore: improving code coverage to 100% branches#1624profnandaa merged 2 commits intovalidatorjs:masterfrom renanmontebelo:coverage-license-plates
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1624 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 100 100
Lines 1807 1800 -7
=========================================
- Hits 1807 1800 -7
Continue to review full report at Codecov.
|
tux-tn
left a comment
There was a problem hiding this comment.
Thank you @renanmontebelo ! Good catch 🎉
I have some questions/suggestions :
- Do you think you can make the same change to other places where we are using
hasOwnProperty? When i added code coverage to the project i used another approach and ignored the else branch of the condition. You can search for// istanbul ignore elseto find them. - Do you think it's harmless to disable
guard-for-indirectly in eslint config ? - According to istanbul there is another uncovered branch here in
isStrongPassword. Can you take care of it as well?
|
@tux-tn I pushed a new commit for the coverage issue in About the other points you mentioned, I think it will be a case-by-case thing. As you can see, the For These are very good points for discussion you mentioned. |
tux-tn
left a comment
There was a problem hiding this comment.
I guess it's because you removed lines. Hits are total covered lines of code and the total is matching the number in your screenshot. Thank you again! LGTM 🎉
I guess we can leave the other occurences of hasOwnProperty as it right now.

In isLicensePlate.js the
hasOwnProperty()function is being used probably as a requirement of es-lintguard-for-inrule. In my opinion this linter rule brings no value here and it's preventing 100% branch coverage in tests.Checklist