* Open a websocket and wait for it to fully open.
(requestPath: string, options?: Websocket.ClientOptions)
| 89 | * Open a websocket and wait for it to fully open. |
| 90 | */ |
| 91 | public wsWait(requestPath: string, options?: Websocket.ClientOptions): Promise<Websocket> { |
| 92 | const ws = this.ws(requestPath, options) |
| 93 | return new Promise<Websocket>((resolve, reject) => { |
| 94 | ws.on("error", (err) => reject(err)) |
| 95 | ws.on("open", () => resolve(ws)) |
| 96 | }) |
| 97 | } |
| 98 | |
| 99 | public port(): number { |
| 100 | const addr = this.hs.address() |
no test coverage detected