MCPcopy
hub / github.com/coder/mux / mockFetchRichParams

Function mockFetchRichParams

src/node/services/coderService.test.ts:891–903  ·  view source on GitHub ↗
(
      params: Array<{
        name: string;
        default_value: string;
        ephemeral?: boolean;
        required?: boolean;
      }>
    )

Source from the content-addressed store, hash-verified

889
890 // Helper to mock fetch for rich parameters API
891 function mockFetchRichParams(
892 params: Array<{
893 name: string;
894 default_value: string;
895 ephemeral?: boolean;
896 required?: boolean;
897 }>
898 ) {
899 global.fetch = vi.fn().mockResolvedValue({
900 ok: true,
901 json: () => Promise.resolve(params),
902 }) as unknown as typeof fetch;
903 }
904
905 it("streams stdout/stderr lines and passes expected args", async () => {
906 mockPrefetchCalls();

Callers 1

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected