From 38b2fa9dc5d72cf995c4639aecb3024ffeb2d651 Mon Sep 17 00:00:00 2001 From: Drake Costa Date: Tue, 22 Jul 2025 06:30:46 -0700 Subject: [PATCH] fix missing listen call for msw, resolve test type error --- apps/studio/tests/features/logs/LogsPreviewer.test.tsx | 2 +- apps/studio/tests/vitestSetup.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/studio/tests/features/logs/LogsPreviewer.test.tsx b/apps/studio/tests/features/logs/LogsPreviewer.test.tsx index cc7051267e8..af44a42a950 100644 --- a/apps/studio/tests/features/logs/LogsPreviewer.test.tsx +++ b/apps/studio/tests/features/logs/LogsPreviewer.test.tsx @@ -32,7 +32,7 @@ vi.mock('lib/gotrue', async (importOriginal) => ({ beforeEach(() => { addAPIMock({ method: 'get', - path: '/platform/projects/default/analytics/endpoints/logs.all', + path: '/platform/projects/:ref/analytics/endpoints/logs.all', response: LOGS_API_MOCKS, }) }) diff --git a/apps/studio/tests/vitestSetup.ts b/apps/studio/tests/vitestSetup.ts index bb6ffdaefd7..00ac0696c07 100644 --- a/apps/studio/tests/vitestSetup.ts +++ b/apps/studio/tests/vitestSetup.ts @@ -16,6 +16,7 @@ import { mswServer } from './lib/msw' // }) beforeAll(() => { + mswServer.listen({ onUnhandledRequest: `error` }) vi.mock('next/router', () => require('next-router-mock')) vi.mock('next/navigation', async () => { const actual = await vi.importActual('next/navigation')