From d747a71df23da0f3904e45728f68bc5d8ab91f31 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Tue, 15 Sep 2026 12:00:04 -0700 Subject: [PATCH] test(desktop): type the fresh-module MCP health import without an import() annotation The repo's eslint config forbids `typeof import(...)` type annotations (@typescript-eslint/consistent-type-imports); derive the module type from the dynamic-import thunk instead so `npm run check:lint` stays at 0 errors. --- apps/desktop/src/store/mcp-health.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/store/mcp-health.test.ts b/apps/desktop/src/store/mcp-health.test.ts index c4e8dd9b8c..2326f5c10a 100644 --- a/apps/desktop/src/store/mcp-health.test.ts +++ b/apps/desktop/src/store/mcp-health.test.ts @@ -78,6 +78,9 @@ afterEach(() => { mocks.setMcpServerEnabled.mockClear() }) +type McpHealthModule = Awaited> +const importMcpHealth = () => import('./mcp-health') + describe('shouldNotify', () => { const DAY = 24 * 60 * 60 * 1000 const now = 1_000_000 @@ -164,7 +167,7 @@ it('honors a persisted snooze in a fresh module session, then re-notifies after let clock = 1_700_000_000_000 const until = clock + 24 * 60 * 60 * 1000 const nowSpy = vi.spyOn(Date, 'now').mockImplementation(() => clock) - let freshSession: typeof import('./mcp-health') | undefined + let freshSession: McpHealthModule | undefined try { window.localStorage.setItem(key, String(until)) @@ -173,7 +176,7 @@ it('honors a persisted snooze in a fresh module session, then re-notifies after // A fresh import drops in-memory transition state, as a renderer restart does. vi.resetModules() - freshSession = await import('./mcp-health') + freshSession = await importMcpHealth() freshSession.startMcpHealthChecker() mocks.gatewayState.set('open') await flush()