Skip to content

Commit 0f4717e

Browse files
fix: mock @calcom/lib/i18n in EventManager.test.ts to prevent vitest worker shutdown flake (calcom#28630)
* fix: mock @calcom/lib/i18n in EventManager.test.ts to prevent vitest worker shutdown flake TranslationService transitively imports @calcom/lib/i18n which triggers slow module resolution via vite's RPC. When the vitest worker shuts down before it completes, it causes 'Closing rpc while fetch was pending' errors. Mocking the module prevents the actual module resolution during test loading. Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com> * chore: remove explanatory comments per review feedback Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent ad791f8 commit 0f4717e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/features/bookings/lib/EventManager.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ vi.mock("@calcom/features/watchlist/operations/check-if-users-are-blocked.contro
1818
vi.mock("@calcom/features/watchlist/lib/telemetry", () => ({
1919
sentrySpan: vi.fn(),
2020
}));
21+
vi.mock("@calcom/lib/i18n", () => ({
22+
locales: ["en"],
23+
localeOptions: [{ value: "en", label: "English" }],
24+
defaultLocaleOption: { value: "en", label: "English" },
25+
}));
2126

2227
import process from "node:process";
2328
import { CredentialRepository } from "@calcom/features/credentials/repositories/CredentialRepository";

0 commit comments

Comments
 (0)