MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / createRestAppClient

Function createRestAppClient

packages/testlab/src/client.ts:35–43  ·  view source on GitHub ↗
(app: RestApplicationLike)

Source from the content-addressed store, hash-verified

33 * @param app - A running (listening) instance of a RestApplication.
34 */
35export function createRestAppClient(app: RestApplicationLike) {
36 const url = app.restServer.rootUrl ?? app.restServer.url;
37 if (!url) {
38 throw new Error(
39 `Cannot create client for ${app.constructor.name}, it is not listening.`,
40 );
41 }
42 return supertest(url);
43}
44
45/*
46 * These interfaces are meant to partially mirror the formats provided

Callers 15

setupApplicationFunction · 0.90
startMethod · 0.90
givenAClientFunction · 0.90
givenAClientFunction · 0.90
givenAnAppAndAClientFunction · 0.90
givenAClientFunction · 0.90

Calls

no outgoing calls

Tested by 15

setupApplicationFunction · 0.72
startMethod · 0.72
givenAClientFunction · 0.72
givenAClientFunction · 0.72
givenAnAppAndAClientFunction · 0.72
givenAClientFunction · 0.72
givenAClientFunction · 0.72
givenAClientFunction · 0.72
givenAClientFunction · 0.72
setupTestScenarioFunction · 0.72