(app: RestApplicationLike)
| 33 | * @param app - A running (listening) instance of a RestApplication. |
| 34 | */ |
| 35 | export 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 |
no outgoing calls