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

Function setupFetchMock

apps/sim/tools/index.test.ts:360–365  ·  view source on GitHub ↗

* Sets up global fetch mock with Next.js preconnect support.

(config: MockFetchResponse = {})

Source from the content-addressed store, hash-verified

358 * Sets up global fetch mock with Next.js preconnect support.
359 */
360function setupFetchMock(config: MockFetchResponse = {}) {
361 const mockFetch = createMockFetch(config)
362 const fetchWithPreconnect = Object.assign(mockFetch, { preconnect: vi.fn() }) as typeof fetch
363 global.fetch = fetchWithPreconnect
364 return mockFetch
365}
366
367/**
368 * Creates a mock execution context with workspaceId for tool tests.

Callers 1

index.test.tsFile · 0.85

Calls 1

createMockFetchFunction · 0.90

Tested by

no test coverage detected