Jest · Method
jest.restoreAllMocks
Restores spies and replaced properties to their original state. Use it after each test to prevent test changes from leaking into other tests.
Last updated
Syntax
jest.restoreAllMocks()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
jest.spyOnjest.replacePropertyjest.clearAllMocksjest.resetAllMocksmockRestorerestoreafterEach