Skip to content
masterclass Buddy

Jest · Type Alias

jest.Mock

jest.Mock is the TypeScript type for a Jest mock function. It lets tests inspect calls and control what the function returns.

Last updated

Syntax

jest.fn<T, Y extends any[]>(implementation?: (...args: Y) => T): jest.Mock<T, Y>

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

Subscribe
  • jest.fn
  • jest.Mocked
  • jest.mocked
  • jest.Spied
  • mockFn.mock.calls
  • mockFn.mock.results
  • mockFn.mock.instances
  • mockFn.mock.contexts

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