Wrap a function with mock definitions
import { myFunction } from "./library"; jest.mock("./library"); const mockMyFunction = myFunction as jest.MockedFunction<typeof myFunction>; expect(mockMyFunction.mock.calls[0][0]).toBe(42); Copy
import { myFunction } from "./library"; jest.mock("./library"); const mockMyFunction = myFunction as jest.MockedFunction<typeof myFunction>; expect(mockMyFunction.mock.calls[0][0]).toBe(42);
Wrap a function with mock definitions