fix(test): resolve Feishu hoisted mock export syntax error (#32128)

- 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>
This commit is contained in:
ademczuk
2026-03-03 01:34:16 +01:00
committed by GitHub
parent 1b5ac8b0b1
commit 53fd7f8163
2 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import { vi } from "vitest";
export const probeFeishuMock: ReturnType<typeof vi.fn> = vi.hoisted(() => vi.fn());
export const probeFeishuMock: ReturnType<typeof vi.fn> = vi.fn();
vi.mock("./probe.js", () => ({
probeFeishu: probeFeishuMock,