in-process-request
Version:
A node.js library that executes a http handler function in the current process without having to start a local http server.
16 lines (15 loc) • 643 B
TypeScript
/// <reference types="node" />
import { RequestListener } from 'http';
import { MockResponse, MockRequestOptions } from './httpMock';
import { HapiListener } from './hapiListener';
declare namespace handler {
type InProcessRequestOptions = MockRequestOptions;
type InProcessResponse = MockResponse;
}
declare const handler: {
(app: RequestListener): (reqOptions: MockRequestOptions) => Promise<MockResponse>;
HapiListener: typeof HapiListener;
nestHandler: (nestApp: any) => Promise<any>;
fastifyHandler: (fastifyBuilder: (options: object) => any) => (options: object) => Promise<RequestListener>;
};
export = handler;