diff --git a/test_util/local.ts b/test_util/local.ts index a437e5762..216540295 100644 --- a/test_util/local.ts +++ b/test_util/local.ts @@ -5,8 +5,12 @@ const hostname = Deno.env.get("TEST_CTX_HOSTNAME"); const portRaw = Deno.env.get("TEST_CTX_PORT"); class LocalClient extends C.rpc.Client { + url; + constructor(port: number, close: () => void) { - super(C.rpc.proxyProvider, `ws://127.0.0.1:${port}`); + const url = `ws://127.0.0.1:${port}`; + super(C.rpc.proxyProvider, url); + this.url = url; const prevDiscard = this.discard; this.discard = async () => { const closeError = await prevDiscard(); @@ -37,10 +41,6 @@ export class LocalClientEffect extends Z.Effect { - return null!; - } - get client(): Promise { if (!this.#clientPending) { this.#clientPending = this.createClient(); @@ -48,6 +48,10 @@ export class LocalClientEffect extends Z.Effect { + return this.client.then(({ url }) => url); + } + private async createClient(): Promise { let port: number; let close = () => {};