- Remove vi.hoisted() wrapper from exported mock in shared module (Vitest cannot export hoisted variables) - Inline vi.hoisted + vi.mock in startup test so Vitest's per-file hoisting registers mocks before production imports Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
13 lines
325 B
TypeScript
13 lines
325 B
TypeScript
import { vi } from "vitest";
|
|
|
|
export const probeFeishuMock: ReturnType<typeof vi.fn> = vi.fn();
|
|
|
|
vi.mock("./probe.js", () => ({
|
|
probeFeishu: probeFeishuMock,
|
|
}));
|
|
|
|
vi.mock("./client.js", () => ({
|
|
createFeishuWSClient: vi.fn(() => ({ start: vi.fn() })),
|
|
createEventDispatcher: vi.fn(() => ({ register: vi.fn() })),
|
|
}));
|