import Server from './Server'; import { HeaderValue } from './Assertions'; export default class Test implements PromiseLike { private _pServer; private _description; private _result; private _assertions; constructor(pServer: Promise, url: string | Request, init?: RequestInit); private _fetchPriv; /** * Verify status code and body. * * @param statusCode - The expected status code. * @param [body] - The expected body. */ expect(statusCode: number, body?: unknown): this; /** * Verify a header exists. This is an alias for `expectHeader()`. * * @param header - The header name. * @param value - The expected header value. */ expect(header: string, value: HeaderValue): this; /** * Verify body exists. This is an alias for `expectBody()`. * * @param body - The expected body. If this is an object, then we expect * * @param value - The expected header value. */ expect(body: unknown): this; /** * Verify the status code (and optionally the status text) of a response. * * @param statusCode - Expected status code. * @param [statusText] - Expected status text. */ expectStatus(statusCode: number, statusText?: string): this; /** * Verify the body of a response. * * @param expectedBody - The body to verify. This can be either a string, a regex, * or a JSON object. If an object, this will treat the response like JSON * data. Passing `null` or `undefined` to expectBody will verify that the * response has no content-length or transfer-encoding header. */ expectBody(expectedBody: unknown): this; /** * Verifies a header exists and has the specified value. * * @param name - The header to check for. * @param value - The value to verify. If `null` or `undefined`, this will * verify the header is not present. */ expectHeader(name: string, value: HeaderValue): this; end(): Promise; /** * Tests are 'thennable', so you can treat them like a Promise and get back * the WHAT-WG fetch response. */ then(onfulfilled?: ((value: Response) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | undefined | null): PromiseLike; private _should; /** * Returns the JSON contents of the response. */ json(): Promise; }