-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Validate if spy or mock was passed when expected #203
Conversation
Codecov Report
@@ Coverage Diff @@
## main #203 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 125 125
Lines 774 792 +18
Branches 115 124 +9
=========================================
+ Hits 774 792 +18
Continue to review full report at Codecov.
|
df9a436
to
13ee080
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.
This is a really great PR, and going to be really useful as more mocking matchers are added 🎉.
Ive stuck a comment on one little bit where I couldn't read the logic easily which could lead to it being hard to maintain in the future.
Also just worrying abit about how clear we are being to our users on the error message outputted :)
Hope to hear from you soon about how you feel about these comments 😺
13ee080
to
4aa02cb
Compare
4aa02cb
to
cbf296c
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.
thanks!
What
Add error to
toHaveBeenCalledBefore
andtoHaveBeenCalledAfter
matchers in case passed params are not instances ofjest.Mock
Why
Jest has similar errors when non spy or mock is passed to
toHaveBeenCalled
or other mock-related matchers.