Page Contents

Home > @loopback/testlab > createClientForHandler

createClientForHandler() function

Create a SuperTest client connected to an HTTP server listening on an ephemeral port and calling handler to handle incoming requests.

Signature:

export declare function createClientForHandler(handler: (req: http.IncomingMessage, res: http.ServerResponse) => void): Client;

Parameters

Parameter Type Description
handler (req: http.IncomingMessage, res: http.ServerResponse) => void  

Returns:

Client