(status: number)
| 14 | } |
| 15 | |
| 16 | const mockFetchError = (status: number) => { |
| 17 | const fetchMock = vi.fn().mockResolvedValue({ |
| 18 | ok: false, |
| 19 | status, |
| 20 | }) |
| 21 | vi.stubGlobal('fetch', fetchMock) |
| 22 | return fetchMock |
| 23 | } |
| 24 | |
| 25 | const mockCreateError = () => { |
| 26 | const createErrorMock = vi.fn((opts: { statusCode: number; message: string }) => opts) |