import { functionToMock } from "@module/api"; jest.mock("@module/api", () => { const original = jest.requireActual("@module/api"); return { ...original, functionToMock: jest.fn() }; });