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.
SubscribeRelated
jest.fnjest.Mockedjest.mockedjest.SpiedmockFn.mock.callsmockFn.mock.resultsmockFn.mock.instancesmockFn.mock.contexts