Skip to content

Class: FakeTransport ​

A transport driven by a handler. Records every request for assertions.

Implements ​

Constructors ​

Constructor ​

ts
new FakeTransport(handler): FakeTransport;

Parameters ​

ParameterType
handlerFakeHandler

Returns ​

FakeTransport

Properties ​

PropertyModifierTypeDefault value
requestsreadonlyHttpRequest[][]

Methods ​

request() ​

ts
request(req): Promise<HttpResponse>;

Records the request and returns what the handler answers.

Parameters ​

ParameterType
reqHttpRequest

Returns ​

Promise<HttpResponse>

Implementation of ​

HttpTransport.request

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.