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

Function makeClient

src/lib/http.test.ts:30–43  ·  view source on GitHub ↗
(
  fetchImpl: typeof fetch,
  options: { apiKey?: string | null; onDebug?: (e: DebugEvent) => void } = {},
)

Source from the content-addressed store, hash-verified

28}
29
30function makeClient(
31 fetchImpl: typeof fetch,
32 options: { apiKey?: string | null; onDebug?: (e: DebugEvent) => void } = {},
33): HttpClient {
34 const apiKey = 'apiKey' in options ? (options.apiKey ?? undefined) : 'sk-test';
35 return new HttpClient({
36 baseUrl: 'https://api.example.com/api/cli/v1',
37 apiKey,
38 fetchImpl,
39 sleep: () => Promise.resolve(),
40 random: () => 0,
41 onDebug: options.onDebug,
42 });
43}
44
45describe('buildUrl', () => {
46 it('handles trailing slashes and absolute paths', () => {

Callers 1

http.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected