Factory function that creates mock functions. Pass vi.fn (Vitest) or jest.fn (Jest) to get spy capabilities. When omitted, plain no-op functions are used.
vi.fn
jest.fn
// Vitest — enables toHaveBeenCalledWith() assertionsconst ctx = createMockIntegrationContext(vi.fn);// Jestconst ctx = createMockIntegrationContext(jest.fn);// No framework — plain no-opsconst ctx = createMockIntegrationContext(); Copy
// Vitest — enables toHaveBeenCalledWith() assertionsconst ctx = createMockIntegrationContext(vi.fn);// Jestconst ctx = createMockIntegrationContext(jest.fn);// No framework — plain no-opsconst ctx = createMockIntegrationContext();
Factory function that creates mock functions. Pass
vi.fn(Vitest) orjest.fn(Jest) to get spy capabilities. When omitted, plain no-op functions are used.