Skip to content
masterclass Buddy

Jest · Type Alias

jest.SpyInstance

Jest mock functions record how code calls a function. Create one with jest.fn(), then inspect or control its behavior in a test.

Last updated

Syntax

jest.fn(implementation?)

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

Subscribe
  • jest.fn()
  • jest.isMockFunction(fn)
  • mockFn.mock.calls
  • mockFn.mock.results
  • mockFn.mock.instances
  • mockFn.mockClear()
  • mockFn.mockReset()
  • mockFn.mockRestore()

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