expect: Improve report when matcher fails, part 10#7960
expect: Improve report when matcher fails, part 10#7960SimenB merged 2 commits intojestjs:masterfrom
Conversation
jeysal
left a comment
There was a problem hiding this comment.
Already conceptionally approved this in our discussion, found nothing too complain about in this implementation either :) great work!
Codecov Report
@@ Coverage Diff @@
## master #7960 +/- ##
=========================================
Coverage ? 64.93%
=========================================
Files ? 255
Lines ? 10021
Branches ? 1365
=========================================
Hits ? 6507
Misses ? 3200
Partials ? 314
Continue to review full report at Codecov.
|
|
Could we pad the quote character so it plays nice with emojis? Totally unrelated to the fix, of course |
I think doing this is (in general, perhaps not in some controlled environments) a dangerous path to go because it can wreck alignment in the monospace grid. Terminal emulators for good reasons render overlapping characters instead of doing padding magic. |
|
Yeah, good thinking. The picture was humorous result from serious attempt at realistic failure because of incorrect expected length related to Unicode. |
|
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
For
.toHaveLengthmatcher:ensureExpectedIsNonNegativeIntegerfunction withoptionsargumentExpected length:labelnotexpected value (am happy if y’all can suggest as an alternative a concise explicit way to communicate that is reason why test fails)For more information, see discussion with @jeysal in #7795
Test plan
.not.rejectsand.resolvesSee also pictures in following comment