MCPcopy
hub / github.com/langgenius/dify / createHttpClient

Function createHttpClient

sdks/nodejs-client/tests/test-utils.ts:19–26  ·  view source on GitHub ↗
(
  configOverrides: Partial<DifyClientConfig> = {}
)

Source from the content-addressed store, hash-verified

17};
18
19export const createHttpClient = (
20 configOverrides: Partial<DifyClientConfig> = {}
21): HttpClientWithFetchMock => {
22 const fetchMock = vi.fn();
23 vi.stubGlobal("fetch", fetchMock);
24 const client = new HttpClient({ apiKey: "test", ...configOverrides });
25 return { client, fetchMock };
26};
27
28export const createHttpClientWithSpies = (
29 configOverrides: Partial<DifyClientConfig> = {}

Callers 4

testHttpClientFunction · 0.90
orpcClientFunction · 0.90
client.test.tsFile · 0.90

Calls

no outgoing calls

Tested by 1

orpcClientFunction · 0.72