Jest · Module
mockClear
mockFn.mockClear() removes recorded usage data from one Jest mock. It clears calls, results, instances, and contexts while keeping the mock function available.
Last updated
Syntax
mockFn.mockClear()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
jest.clearAllMocks()mockFn.mockReset()mockFn.mockRestore()mockFn.mock.callsmockFn.mock.resultsmockFn.mock.instancesmockFn.mock.contexts