diff options
author | Samrith Shankar <samrith-s@users.noreply.github.com> | 2020-03-20 14:38:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-20 09:38:34 -0400 |
commit | 798904b0f2ed0c7284b67bba2f125f406b5850de (patch) | |
tree | 5aba8d35aa8984aa778c894258bcaed56f1ce17c /std/ws/test.ts | |
parent | 35f6e2e45ddb96524a6bdf54b0a6155caa88d5e0 (diff) |
Add require-await lint rule (#4401)
Diffstat (limited to 'std/ws/test.ts')
-rw-r--r-- | std/ws/test.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/std/ws/test.ts b/std/ws/test.ts index 820fe1423..f1efa8e40 100644 --- a/std/ws/test.ts +++ b/std/ws/test.ts @@ -126,7 +126,7 @@ test("[ws] read unmasked bigger binary frame", async () => { assertEquals(bin.payload.length, payloadLength); }); -test("[ws] createSecAccept", async () => { +test("[ws] createSecAccept", () => { const nonce = "dGhlIHNhbXBsZSBub25jZQ=="; const d = createSecAccept(nonce); assertEquals(d, "s3pPLMBiTxaQ9kYGzzhZRbK+xOo="); @@ -335,8 +335,8 @@ test("[ws] createSecKeyHasCorrectLength", () => { test("[ws] WebSocket should throw `Deno.errors.ConnectionReset` when peer closed connection without close frame", async () => { const buf = new Buffer(); const eofReader: Deno.Reader = { - async read(_: Uint8Array): Promise<number | Deno.EOF> { - return Deno.EOF; + read(_: Uint8Array): Promise<number | Deno.EOF> { + return Promise.resolve(Deno.EOF); } }; const conn = dummyConn(eofReader, buf); @@ -353,8 +353,8 @@ test("[ws] WebSocket should throw `Deno.errors.ConnectionReset` when peer closed test("[ws] WebSocket shouldn't throw `Deno.errors.UnexpectedEof` on recive()", async () => { const buf = new Buffer(); const eofReader: Deno.Reader = { - async read(_: Uint8Array): Promise<number | Deno.EOF> { - return Deno.EOF; + read(_: Uint8Array): Promise<number | Deno.EOF> { + return Promise.resolve(Deno.EOF); } }; const conn = dummyConn(eofReader, buf); @@ -372,7 +372,7 @@ test({ const buf = new Buffer(); let timer: number | undefined; const lazyWriter: Deno.Writer = { - async write(_: Uint8Array): Promise<number> { + write(_: Uint8Array): Promise<number> { return new Promise(resolve => { timer = setTimeout(() => resolve(0), 1000); }); |