-
-
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: describe how to mock/spy class specific method #12257
Conversation
I believe it would be useful for other users to know how to mock/spy just some method of a class. Following these examples here: https://stackoverflow.com/questions/50091438/jest-how-to-mock-one-specific-method-of-a-class
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.
LGTM. could you try to add these in the main docs
folder along with all the other versioned docs
thanks @Biki-das!! Thanks very much |
|
@Biki-das got it ;) |
Codecov Report
@@ Coverage Diff @@
## main #12257 +/- ##
=======================================
Coverage 68.48% 68.48%
=======================================
Files 324 324
Lines 16969 16969
Branches 5061 5061
=======================================
Hits 11622 11622
Misses 5315 5315
Partials 32 32 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.
looks good.
@Biki-das |
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 great, thanks! could you also add this to the other versioned docs?
also, prettier will yell at you, just run yarn lint:prettier
to fix it 🙂
hey @SimenB , sorry for the late update. |
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!
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
I believe it would be useful for other users to know how to mock/spy just some method of a class.
Following these examples here:
https://stackoverflow.com/a/56565849/1538604
Test plan
no test required, this is just documentation