-
-
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
fix: make Errors match with ordinary objects (fixes #5359) #5611
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5611 +/- ##
=======================================
Coverage 60.63% 60.63%
=======================================
Files 213 213
Lines 7311 7311
Branches 4 4
=======================================
Hits 4433 4433
Misses 2877 2877
Partials 1 1 Continue to review full report at Codecov.
|
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.
Makes sense
Thanks for submitting a PR to Jest! |
@@ -2,6 +2,8 @@ | |||
|
|||
### Fixes | |||
|
|||
* `[enzyme]` Allow matching of Errors against plain objects |
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.
not enzyme, wrong matcher library :D
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.
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.
ah, nice!
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
Fixes #5359 -- makes toMatchObject work when comparing
Error
s with ordinary objects. This is accomplished by extending subset matching algorithm to include prototype properties of the object under test.Test plan
Added two test cases in
matchers.test.js
. No other tests were modified.However,
yarn test
fails with the following error:Bonkers. Let's see if CI catches that one too.