-
-
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
Use iterableEquality in spy matchers #3651
Use iterableEquality in spy matchers #3651
Conversation
82bd3c3
to
8b79691
Compare
After a quick test, it seems like this also fixes #3619. Should I add the example as another test? |
If you can think of any other valid example, you're more than welcome to do so! 🙂 |
da50ded
to
709966f
Compare
Codecov Report
@@ Coverage Diff @@
## master #3651 +/- ##
==========================================
+ Coverage 58.08% 58.09% +0.01%
==========================================
Files 195 195
Lines 6751 6751
Branches 6 6
==========================================
+ Hits 3921 3922 +1
+ Misses 2827 2826 -1
Partials 3 3
Continue to review full report at Codecov.
|
@thymikee Perfect! I added tests to ensure that the matchers work with ES6 I'm not 100% sure if this is really a fix for #3574, since |
@thymikee Is there anything else I can do to help get this merged? :) |
Just wait for @cpojer to review :) |
709966f
to
07ef0ca
Compare
Would you mind rebasing this? |
While working on custom matchers to solve jestjs#3574, I found out that the cause for not seeing this issue in `expect().toEqual()` comes from the fact that this matcher passes the `iterableEquality` to the `equals()` function. When I added this to the equal calls for our spy matchers as well, Immutable.js types were properly suppored. I'm considering this is a bug since the `toBeCalledWith()` matchers should behave the same as the `equals()` matcher.
07ef0ca
to
4a0daf8
Compare
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.
Looks good 👍
Nice! Thank you. |
* Use iterableEquality in spy matchers While working on custom matchers to solve jestjs#3574, I found out that the cause for not seeing this issue in `expect().toEqual()` comes from the fact that this matcher passes the `iterableEquality` to the `equals()` function. When I added this to the equal calls for our spy matchers as well, Immutable.js types were properly suppored. I'm considering this is a bug since the `toBeCalledWith()` matchers should behave the same as the `equals()` matcher. * Add spy matchers tests using ES6 Map and Set
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. |
Fixes #3574
FIxes #3619
Summary
While working on custom matchers to solve #3574, I found out that the cause for
not seeing this issue in
expect().toEqual()
comes from the fact that thismatcher passes the
iterableEquality
to theequals()
function.When I added this to the equal calls for our spy matchers as well, Immutable.js
types were properly suppored.
I'm considering this is a bug since the
toBeCalledWith()
matchers shouldbehave the same as the
equals()
matcher.Test plan
I added a unit test that uses the already included
Immutable.js
library.