diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-06-09 12:18:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 13:18:18 +0200 |
commit | b3e189ee4f97a9d6c5b7a2164d644aa4c7fa4b79 (patch) | |
tree | 31b8f4f39e730ed017889671f87dd19ad714caac /std/examples/chat/server_test.ts | |
parent | 54742d29dce4230c36db28fb2306589b8e57d3d9 (diff) |
fix(cli/js/process): Strengthen socket types based on pipes (#4836)
Diffstat (limited to 'std/examples/chat/server_test.ts')
-rw-r--r-- | std/examples/chat/server_test.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/std/examples/chat/server_test.ts b/std/examples/chat/server_test.ts index 7375de47a..8e04b71d8 100644 --- a/std/examples/chat/server_test.ts +++ b/std/examples/chat/server_test.ts @@ -7,7 +7,9 @@ import { delay } from "../../async/delay.ts"; const { test } = Deno; -async function startServer(): Promise<Deno.Process> { +async function startServer(): Promise< + Deno.Process<Deno.RunOptions & { stdout: "piped" }> +> { const server = Deno.run({ // TODO(lucacasonato): remove unstable once possible cmd: [ @@ -27,7 +29,7 @@ async function startServer(): Promise<Deno.Process> { const s = await r.readLine(); assert(s !== null && s.includes("chat server starting")); } catch (err) { - server.stdout!.close(); + server.stdout.close(); server.close(); } @@ -46,7 +48,7 @@ test({ assert(html.includes("ws chat example"), "body is ok"); } finally { server.close(); - server.stdout!.close(); + server.stdout.close(); } await delay(10); }, @@ -66,7 +68,7 @@ test({ assertEquals((await it.next()).value, "[1]: Hello"); } finally { server.close(); - server.stdout!.close(); + server.stdout.close(); ws!.conn.close(); } }, |