Skip to content
module@warp-drive/holodeck

Class MockServerHandler ​

Defined in: index.ts:283

A request handler that intercepts requests and routes them through the Holodeck mock server.

This handler modifies the request URL to include test identifiers and manages request counts for accurate mocking.

Requires that the test context be configured with a testId using setTestId.

Param ​

owner

the test context object used to retrieve the test ID.

Implements ​

  • Handler

Constructors ​

Constructor ​

ts
new MockServerHandler(owner: object): MockServerHandler;

Defined in: index.ts:285

Parameters ​

owner ​

object

Returns ​

MockServerHandler

Methods ​

request() ​

ts
request<T>(context: RequestContext, next: NextFn<T>): Promise<StructuredDataDocument<T>>;

Defined in: index.ts:288

Method to implement to handle requests. Receives the request context and a nextFn to call to pass-along the request to other handlers.

Type Parameters ​

T ​

T

Parameters ​

context ​

RequestContext

next ​

NextFn<T>

Returns ​

Promise<StructuredDataDocument<T>>

Implementation of ​

ts
Handler.request

Properties ​

owner ​

ts
owner: object;

Defined in: index.ts:284

Released under the MIT License.