@opra/testing
Version:
Opra testing package
20 lines (19 loc) • 781 B
TypeScript
import { FetchBackend, HttpClientBase, kBackend } from '@opra/client';
import { IncomingMessage, Server, ServerResponse } from 'http';
import { ApiExpect } from './api-expect/api-expect.js';
import { TestBackend } from './test-backend.js';
declare type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
export declare const kContext: unique symbol;
export type ResponseExt = {
expect: ApiExpect;
};
export declare namespace OpraTestClient {
interface Options extends FetchBackend.Options {
basePath?: string;
}
}
export declare class OpraTestClient extends HttpClientBase<FetchBackend.RequestOptions, ResponseExt> {
[kBackend]: TestBackend;
constructor(app: Server | RequestListener, options?: OpraTestClient.Options);
}
export {};