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