Add toHaveErrorMessage matcher#370
Conversation
update test cases to match example
gnapse
left a comment
There was a problem hiding this comment.
Thanks a lot for this. Very thorough implementation and tests. Thanks.
Codecov Report
@@ Coverage Diff @@
## main #370 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 24 +1
Lines 554 584 +30
Branches 199 215 +16
=========================================
+ Hits 554 584 +30
Continue to review full report at Codecov.
|
|
@all-contributors please add @SevenOutman for code, test |
|
I've put up a pull request to add @SevenOutman! 🎉 |
|
🎉 This PR is included in version 5.13.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
@kentcdodds I'd recommend using this matcher for testing form validation instead of |
|
Sounds great. What showcase are you referring to? |
I remember seeing several in Testing Javascript courses, but couldn't recall which exactly. |
|
I'll keep it in mind in the future! Thanks 👍 |
|
Seeing this after the fact. 😅 Just as a heads up @kentcdodds @SevenOutman, the It seems that for right now, the recommended way of conveying error messages to users is still to use In the meantime, any documentation or examples that use |
What:
feature:
.toHaveErrorMessagematcher to check whether an invalid element has requested error message.Why:
This PR is basically a replacement of the stale PR #258 which implements proposal #256.
How:
Most implementation and tests are copied from the original PR with some modification to address testing issues.
Checklist: