diff --git a/apps/web/src/test/setupGlobals.ts b/apps/web/src/test/setupGlobals.ts index bdcb327151..0867071bcc 100644 --- a/apps/web/src/test/setupGlobals.ts +++ b/apps/web/src/test/setupGlobals.ts @@ -16,5 +16,9 @@ vi.stubGlobal("AudioContext", function () { if (globalThis.window === undefined) { // We are in a node environment, stub a basic window so singletons work - vi.stubGlobal("window", {}); + vi.stubGlobal("window", { + // Mock this as some code assumes it exists (needs to be done at the top level as + // things try to access it before the beforeEach blocks run) + addEventListener: vi.fn(), + }); }