mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:31:24 +00:00
fix(test): avoid vitest mock type inference issues
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
export const callGatewayMock = vi.fn();
|
||||
// Avoid exporting inferred vitest mock types (TS2742 under pnpm + d.ts emit).
|
||||
export type CallGatewayMock = ((opts: unknown) => unknown) & ReturnType<typeof vi.fn>;
|
||||
export const callGatewayMock: CallGatewayMock = vi.fn() as unknown as CallGatewayMock;
|
||||
vi.mock("../gateway/call.js", () => ({
|
||||
callGateway: (opts: unknown) => callGatewayMock(opts),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user