MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / mockRegistryFetch

Function mockRegistryFetch

apps/kimi-code/test/cli/provider.test.ts:172–182  ·  view source on GitHub ↗
(body: unknown = REGISTRY_BODY, status = 200)

Source from the content-addressed store, hash-verified

170});
171
172function mockRegistryFetch(body: unknown = REGISTRY_BODY, status = 200): ReturnType<typeof vi.fn> {
173 const fetchMock = vi.fn(
174 async () =>
175 new Response(JSON.stringify(body), {
176 status,
177 headers: { 'Content-Type': 'application/json' },
178 }),
179 );
180 globalThis.fetch = fetchMock as unknown as typeof globalThis.fetch;
181 return fetchMock;
182}
183
184const CATALOG_BODY = {
185 anthropic: {

Callers 1

provider.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected