diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-29 18:45:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 18:45:47 +0100 |
commit | f55b22e195ff0dfaf117aaef2a0fcc51fe0058c8 (patch) | |
tree | c314180b02b1ebf6b3f75ccbb4decade3b4fb511 /cli/js/tls_test.ts | |
parent | 199fb195f334b582e4ee3fccaa9a33aa2a06ca48 (diff) |
add assertResources sanitizer to cli/js/ unit tests (#4161)
Diffstat (limited to 'cli/js/tls_test.ts')
-rw-r--r-- | cli/js/tls_test.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cli/js/tls_test.ts b/cli/js/tls_test.ts index 698321274..0fb4cbb7b 100644 --- a/cli/js/tls_test.ts +++ b/cli/js/tls_test.ts @@ -1,5 +1,11 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { test, testPerm, assert, assertEquals } from "./test_util.ts"; +import { + test, + testPerm, + assert, + assertEquals, + createResolvable +} from "./test_util.ts"; import { BufWriter, BufReader } from "../../std/io/bufio.ts"; import { TextProtoReader } from "../../std/textproto/mod.ts"; @@ -142,6 +148,7 @@ testPerm( testPerm({ read: true, net: true }, async function dialAndListenTLS(): Promise< void > { + const resolvable = createResolvable(); const hostname = "localhost"; const port = 4500; @@ -164,6 +171,7 @@ testPerm({ read: true, net: true }, async function dialAndListenTLS(): Promise< // TODO(bartlomieju): this might be a bug setTimeout(() => { conn.close(); + resolvable.resolve(); }, 0); } ); @@ -196,4 +204,6 @@ testPerm({ read: true, net: true }, async function dialAndListenTLS(): Promise< await r.readFull(bodyBuf); assertEquals(decoder.decode(bodyBuf), "Hello World\n"); conn.close(); + listener.close(); + await resolvable; }); |