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.
SubscribeRelated
jest.fn()mockFn.mock.callsmockFn.mock.resultsmockFn.mockClear()mockFn.mockImplementation()jest.Mocked<Source>