From 0f4717e0be7da347c3c7cb0b4d241eb7e5b39ba4 Mon Sep 17 00:00:00 2001 From: Romit <85230081+romitg2@users.noreply.github.com> Date: Sat, 28 Mar 2026 20:07:18 +0530 Subject: [PATCH] fix: mock @calcom/lib/i18n in EventManager.test.ts to prevent vitest worker shutdown flake (#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 * chore: remove explanatory comments per review feedback Co-Authored-By: romitgabani1 --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- packages/features/bookings/lib/EventManager.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/features/bookings/lib/EventManager.test.ts b/packages/features/bookings/lib/EventManager.test.ts index 516a5e7b47..1eff2eb1a2 100644 --- a/packages/features/bookings/lib/EventManager.test.ts +++ b/packages/features/bookings/lib/EventManager.test.ts @@ -18,6 +18,11 @@ vi.mock("@calcom/features/watchlist/operations/check-if-users-are-blocked.contro vi.mock("@calcom/features/watchlist/lib/telemetry", () => ({ sentrySpan: vi.fn(), })); +vi.mock("@calcom/lib/i18n", () => ({ + locales: ["en"], + localeOptions: [{ value: "en", label: "English" }], + defaultLocaleOption: { value: "en", label: "English" }, +})); import process from "node:process"; import { CredentialRepository } from "@calcom/features/credentials/repositories/CredentialRepository";