From 8a6a496c67ad62038c92b3b70bb0755f9d9d0e6c Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 22 Apr 2026 17:26:15 -0400 Subject: [PATCH] fix(web): drop invalid type-arg on toMatchObject in client tests vitest's toMatchObject doesn't accept a type parameter; tests passed under vitest (esbuild transpile) but svelte-check rejected. Plan-spec bug introduced in 4d1a7f8; fixing here so check is clean before Task 6. Co-Authored-By: Claude Opus 4.7 --- web/src/lib/api/client.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/lib/api/client.test.ts b/web/src/lib/api/client.test.ts index 002cb595..9491f024 100644 --- a/web/src/lib/api/client.test.ts +++ b/web/src/lib/api/client.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, test, vi } from 'vitest'; -import { api, apiFetch, type ApiError } from './client'; +import { api, apiFetch } from './client'; afterEach(() => { vi.unstubAllGlobals(); @@ -37,7 +37,7 @@ describe('apiFetch', () => { test('throws ApiError from error envelope on 4xx', async () => { stubFetch(404, { error: { code: 'not_found', message: 'track not found' } }); - await expect(apiFetch('/api/tracks/x')).rejects.toMatchObject({ + await expect(apiFetch('/api/tracks/x')).rejects.toMatchObject({ code: 'not_found', message: 'track not found', status: 404 @@ -48,7 +48,7 @@ describe('apiFetch', () => { vi.stubGlobal('fetch', vi.fn().mockResolvedValue( new Response('500', { status: 500, statusText: 'Internal Server Error' }) )); - await expect(apiFetch('/api/ping')).rejects.toMatchObject({ + await expect(apiFetch('/api/ping')).rejects.toMatchObject({ code: 'unknown', message: 'Internal Server Error', status: 500