(response: MockFetchResponse)
| 118 | * Configures fetch to return a specific response for the next call. |
| 119 | */ |
| 120 | export function mockNextFetchResponse(response: MockFetchResponse) { |
| 121 | const currentFetch = globalThis.fetch |
| 122 | if (vi.isMockFunction(currentFetch)) { |
| 123 | currentFetch.mockResolvedValueOnce(createMockResponse(response)) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Configures fetch to reject with an error. |
no test coverage detected