1 |
|
2 | import express from 'express';
|
3 | import { IncomingMessage, ServerResponse } from 'http';
|
4 | import { Listener as ShotListener, RequestOptions as ShotRequestOptions, ResponseObject } from 'shot';
|
5 | declare const inject: (dispatchFunc: ShotListener, options: ShotRequestOptions) => Promise<ResponseObject>;
|
6 | export { inject, ShotRequestOptions };
|
7 | export declare function stubServerRequest(options: ShotRequestOptions): IncomingMessage;
|
8 | export type ShotCallback = (response: ResponseObject) => void;
|
9 | export type ShotResponseCtor = new (request: IncomingMessage, onEnd: ShotCallback) => ServerResponse;
|
10 | export declare function stubServerResponse(request: IncomingMessage, onEnd: ShotCallback): ServerResponse;
|
11 | export type ObservedResponse = ResponseObject;
|
12 | export interface HandlerContextStub {
|
13 | request: IncomingMessage;
|
14 | response: ServerResponse;
|
15 | result: Promise<ObservedResponse>;
|
16 | }
|
17 | export declare function stubHandlerContext(requestOptions?: ShotRequestOptions): HandlerContextStub;
|
18 | export interface ExpressContextStub extends HandlerContextStub {
|
19 | app: express.Application;
|
20 | request: express.Request;
|
21 | response: express.Response;
|
22 | result: Promise<ObservedResponse>;
|
23 | }
|
24 | export declare function stubExpressContext(requestOptions?: ShotRequestOptions): ExpressContextStub;
|