Skip to content
masterclass Buddy

Jest · Module

anything

Jest mock functions replace or observe functions during tests. Create one with jest.fn(), configure its behavior, and inspect its calls.

Last updated

Syntax

jest.fn(implementation?)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • jest.fn()
  • mockFn.mock.calls
  • mockFn.mock.results
  • mockFn.mockClear()
  • mockFn.mockImplementation()
  • jest.Mocked<Source>

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