MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / makeRequest

Function makeRequest

apps/web/src/app/api/exa/[...path]/route.test.ts:49–59  ·  view source on GitHub ↗
(
  path: string,
  body: unknown = { query: 'test' },
  headers: Record<string, string> = {}
)

Source from the content-addressed store, hash-verified

47const mockedRecordExaUsage = jest.mocked(recordExaUsage);
48const mockedGetBalanceAndOrgSettings = jest.mocked(getBalanceAndOrgSettings);
49const mockedCaptureException = jest.mocked(captureException);
50const mockedFetch = jest.fn() as jest.MockedFunction<typeof globalThis.fetch>;
51const originalFetch = globalThis.fetch;
52
53function makeRequest(
54 path: string,
55 body: unknown = { query: 'test' },
56 headers: Record<string, string> = {}
57) {
58 return new Request(`http://localhost:3000/api/exa${path}`, {
59 method: 'POST',
60 headers: { 'Content-Type': 'application/json', ...headers },
61 body: JSON.stringify(body),
62 });

Callers 1

route.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected