MCPcopy Index your code
hub / github.com/simstudioai/sim / mockNextFetchResponse

Function mockNextFetchResponse

packages/testing/src/mocks/fetch.mock.ts:120–125  ·  view source on GitHub ↗
(response: MockFetchResponse)

Source from the content-addressed store, hash-verified

118 * Configures fetch to return a specific response for the next call.
119 */
120export 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.

Callers 1

utils.test.tsFile · 0.90

Calls 1

createMockResponseFunction · 0.70

Tested by

no test coverage detected