diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/echo_server.ts | 2 | ||||
| -rw-r--r-- | examples/test.ts | 6 | ||||
| -rw-r--r-- | examples/ws.ts | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/examples/echo_server.ts b/examples/echo_server.ts index 95b9f7413..970df4f8d 100644 --- a/examples/echo_server.ts +++ b/examples/echo_server.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. const { listen, copy } = Deno; -(async () => { +(async (): Promise<void> => { const addr = "0.0.0.0:8080"; const listener = listen("tcp", addr); console.log("listening on", addr); diff --git a/examples/test.ts b/examples/test.ts index a8f4e3548..17d19a312 100644 --- a/examples/test.ts +++ b/examples/test.ts @@ -4,16 +4,16 @@ import { test } from "../testing/mod.ts"; import { assertEquals } from "../testing/asserts.ts"; /** Example of how to do basic tests */ -test(function t1() { +test(function t1(): void { assertEquals("hello", "hello"); }); -test(function t2() { +test(function t2(): void { assertEquals("world", "world"); }); /** A more complicated test that runs a subprocess. */ -test(async function catSmoke() { +test(async function catSmoke(): Promise<void> { const p = run({ args: ["deno", "--allow-read", "examples/cat.ts", "README.md"], stdout: "piped" diff --git a/examples/ws.ts b/examples/ws.ts index 83e890bc0..f5965b7eb 100644 --- a/examples/ws.ts +++ b/examples/ws.ts @@ -10,7 +10,7 @@ async function main(): Promise<void> { console.log("websocket server is running on 0.0.0.0:8080"); for await (const req of serve("0.0.0.0:8080")) { if (req.url === "/ws") { - (async () => { + (async (): Promise<void> => { const sock = await acceptWebSocket(req); console.log("socket connected!"); for await (const ev of sock.receive()) { |
