Skip to content

Documentation / @warp-drive/holodeck / MockServerHandler

Class: MockServerHandler

Defined in: index.ts:209

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

the test context object used to retrieve the test ID.

Implements

Constructors

Constructor

ts
new MockServerHandler(owner): MockServerHandler;

Defined in: index.ts:211

Parameters

owner

object

Returns

MockServerHandler

Methods

request()

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

Defined in: index.ts:214

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

Handler.request

Properties

owner

ts
owner: object;

Defined in: index.ts:210

Released under the MIT License.