From c2329c2f7fbba43a2ee542af7810809b34ee01dc Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 28 Nov 2025 19:56:51 -0800 Subject: [PATCH] fix: Phase 7b - suppress MSW optional dependency errors (34 -> 32 errors) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed TypeScript errors for optional MSW (Mock Service Worker) test dependency. MSW is intentionally optional - tests work with or without it. The dynamic imports are wrapped in try-catch to gracefully handle when MSW is not installed. Added @ts-expect-error comments to suppress TypeScript module resolution errors for the optional dynamic imports, while maintaining the runtime fallback behavior. Changes: - src/lib/api/adapters/test-setup.ts: - Added @ts-expect-error for 'msw/node' dynamic import - Added @ts-expect-error for 'msw' dynamic import - Preserves optional dependency pattern Result: 34 → 32 errors (-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/lib/api/adapters/test-setup.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/api/adapters/test-setup.ts b/src/lib/api/adapters/test-setup.ts index 91895ed2..28def699 100644 --- a/src/lib/api/adapters/test-setup.ts +++ b/src/lib/api/adapters/test-setup.ts @@ -8,7 +8,9 @@ let HttpResponse: any = null async function ensureMSW() { if (mockServer) return try { + // @ts-expect-error - MSW is an optional dependency for testing const mswNode = await import('msw/node') + // @ts-expect-error - MSW is an optional dependency for testing const msw = await import('msw') mockServer = mswNode.setupServer() http = msw.http