-
-
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
Rename restoreAllMocks
to restoreAllSpies
#7757
Comments
On a similar note, add the config option of |
Yeah, good call! Can you add it as a comment to #7185 please? |
I'm currently looking into implementing this and raising a PR. Do you want it tagged against #7185 ? |
Thanks! This would be a breaking change, so we won't do this until later (it'll land as part of Jest 25). We could support both at the same time, but that's kinda meh. Thanks for the offer, though! And please don't hesitate to provide more feedback on other config options. |
Ah fair enough, sounds like the right move. Cheers for quick responses 👍 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Rename
restoreAllMocks
torestoreAllSpies
.Motivation
As stated in the docs here, the
restoreAllMocks
function only restores mocks created withspyOn
. This leads to confusion for newer users.Example
afterEach(jest.restoreAllSpies)
Notes
For backwards compatibility, I would expect
restoreAllMocks
to be aliased torestoreAllSpies
, deprecated, and then removed in a future version.The text was updated successfully, but these errors were encountered: