MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / makeOkFetch

Function makeOkFetch

src/commands/init.test.ts:32–40  ·  view source on GitHub ↗

Mock fetch that returns 200 /me response for any request.

()

Source from the content-addressed store, hash-verified

30
31/** Mock fetch that returns 200 /me response for any request. */
32function makeOkFetch(): InitDeps['fetchImpl'] {
33 return vi.fn(
34 async () =>
35 new Response(JSON.stringify(ME), {
36 status: 200,
37 headers: { 'content-type': 'application/json' },
38 }),
39 ) as unknown as InitDeps['fetchImpl'];
40}
41
42/** Mock fetch that returns 401 for any request (simulates bad key). */
43function makeAuthFailFetch(): InitDeps['fetchImpl'] {

Callers 1

init.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected