export interface JsonInit extends RequestInit { /** * Serialized as the request body, with `content-type: application/json` set * unless `headers` already carries one. Covers every verb, so there is no * `post()`/`put()`/`patch()` triple here. Takes precedence over `body`. */ readonly json?: unknown; } export interface JsonResponse { readonly status: number; readonly headers: Headers; readonly body: T; } /** * `fetch` against one base URL, plus the JSON round-trip every suite otherwise * rewrites. Deliberately not an assertion DSL: it returns values that `expect` * already reads well, so failures point at the assertion rather than at a matcher * this package would have to define. * * `createTestServer` returns one of these already bound to the server it started; * this is here for an app booted some other way. */ export declare class TestClient { /** The server's base URL, as `listen()` returned it. */ readonly url: string; constructor(url: string); /** The raw `Response` - for bytes, HTML, or asserting on a header. */ request(path?: string, init?: JsonInit): Promise; /** Status, headers and parsed body in one await, which is the common assertion. */ json(path?: string, init?: JsonInit): Promise>; } /** `new TestClient(url)`. */ export declare const testClient: (url: string) => TestClient;