-
-
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
docs: update toHaveBeenCalledWith
to include type of equality check
#12222
Conversation
@SimenB ping |
@@ -674,7 +674,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d | |||
|
|||
Also under the alias: `.toBeCalled()` | |||
|
|||
Use `.toHaveBeenCalled` to ensure that a mock function got called. | |||
Use `.toHaveBeenCalled` to ensure that a mock function got called.The specific arguments are checked with a `.toEqual` call. |
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.
this is put in the wrong call
@@ -674,7 +674,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d | |||
|
|||
Also under the alias: `.toBeCalled()` | |||
|
|||
Use `.toHaveBeenCalled` to ensure that a mock function got called. | |||
Use `.toHaveBeenCalled` to ensure that a mock function got called.The specific arguments are checked with a `.toEqual` call. |
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.
wrong call
@@ -674,7 +674,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d | |||
|
|||
Also under the alias: `.toBeCalled()` | |||
|
|||
Use `.toHaveBeenCalled` to ensure that a mock function got called. | |||
Use `.toHaveBeenCalled` to ensure that a mock function got called.The specific arguments are checked with a `.toEqual` call. |
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.
wrong call
@@ -674,7 +674,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d | |||
|
|||
Also under the alias: `.toBeCalled()` | |||
|
|||
Use `.toHaveBeenCalled` to ensure that a mock function got called. | |||
Use `.toHaveBeenCalled` to ensure that a mock function got called.The specific arguments are checked with a `.toEqual` call. |
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.
wrong call
Codecov Report
@@ Coverage Diff @@
## main #12222 +/- ##
=======================================
Coverage 67.52% 67.52%
=======================================
Files 328 328
Lines 17244 17244
Branches 5069 5069
=======================================
Hits 11644 11644
Misses 5567 5567
Partials 33 33 Continue to review full report at Codecov.
|
@Biki-das you've only merged one of the suggestions and not addressed the comment where I didn't leave a suggestion 🙂 |
@SimenB , sorry for this mess up here, i was able to understand the changes and applied them as you said, thanks! |
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.
thanks! 27.5 as well? 🙂
sure |
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.
perfect, thanks!
toHaveBeenCalledWith
to include type of equality check
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. |
The documentation for .toHaveBeenCalledWith doesn't state the type of equality check performed on the argument.
This means that anyone expecting the object argument used in the mock function .toStrictEqual the passed argument will be confused as the call is actually .toEqual and doesn't compare object classes.
FAIL ./index.test.js
✕ toHaveBeenCalledWith doesn't compare objects strictly (22 ms)
● toHaveBeenCalledWith doesn't compare objects strictly