Skip to content
masterclass Buddy

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.

Subscribe
  • jest.clearAllMocks()
  • mockFn.mockReset()
  • mockFn.mockRestore()
  • mockFn.mock.calls
  • mockFn.mock.results
  • mockFn.mock.instances
  • mockFn.mock.contexts

Source: Mock Functions · Jest. Checked 2026-11-03.