-
-
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
Make error messages more explicit for toBeCalledWith assertions #3913
Conversation
wow, looks so much better! |
Could we reverse the ordering so it reads chronologically? |
Sure. Do you still want to show the last |
Maybe let's wait with that until we get more feedback on this |
Codecov Report
@@ Coverage Diff @@
## master #3913 +/- ##
==========================================
+ Coverage 59.85% 59.93% +0.08%
==========================================
Files 196 196
Lines 6760 6777 +17
Branches 6 6
==========================================
+ Hits 4046 4062 +16
- Misses 2711 2712 +1
Partials 3 3
Continue to review full report at Codecov.
|
packages/jest-matchers/package.json
Outdated
@@ -13,6 +13,7 @@ | |||
"jest-get-type": "^20.0.3", | |||
"jest-matcher-utils": "^20.0.3", | |||
"jest-message-util": "^20.0.3", | |||
"jest-regex-util": "^20.0.3" | |||
"jest-regex-util": "^20.0.3", | |||
"lodash.partition": "^4.6.0" |
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.
I don't want this dependency. Can you inline it or find something that isn't lodash? 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.
Will update. 👍
Yeah I like it. |
f928e9e
to
5b78d9b
Compare
@cpojer removed the dependency. |
Awesome! Thank you for making this work. |
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
This adds more information to
toBeCalledWith
assertion fail messages by specifically telling which argument(s) didn't match with the expected value(s).Fix #3523.
I'm not exactly sure about messages. Please have a look and share your ideas. Currently it reports back all argument mismatches from the last 3 (
CALL_PRINT_LIMIT
) calls fortoBeCalledWith
fails. All argument mismatches from the last call forlastCalledWith
fails.