docs(plan): fix invalid toMatchObject<T> type-arg in auth plan
vitest's toMatchObject doesn't accept a type parameter. Removed the
annotation in Task 3 test code (and the unused ApiError import) so
re-runs of the plan don't reintroduce the type error fixed in 8a6a496.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -153,7 +153,7 @@ Create `web/src/lib/api/client.test.ts`:
|
||||
|
||||
```ts
|
||||
import { afterEach, describe, expect, test, vi } from 'vitest';
|
||||
import { apiFetch, type ApiError } from './client';
|
||||
import { apiFetch } from './client';
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllGlobals();
|
||||
@@ -191,7 +191,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<ApiError>({
|
||||
await expect(apiFetch('/api/tracks/x')).rejects.toMatchObject({
|
||||
code: 'not_found',
|
||||
message: 'track not found',
|
||||
status: 404
|
||||
@@ -202,7 +202,7 @@ describe('apiFetch', () => {
|
||||
vi.stubGlobal('fetch', vi.fn().mockResolvedValue(
|
||||
new Response('<html>500</html>', { status: 500, statusText: 'Internal Server Error' })
|
||||
));
|
||||
await expect(apiFetch('/api/ping')).rejects.toMatchObject<ApiError>({
|
||||
await expect(apiFetch('/api/ping')).rejects.toMatchObject({
|
||||
code: 'unknown',
|
||||
message: 'Internal Server Error',
|
||||
status: 500
|
||||
|
||||
Reference in New Issue
Block a user