mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 15:14:33 +00:00
add assertResources sanitizer to cli/js/ unit tests (#4161)
This commit is contained in:
parent
199fb195f3
commit
f55b22e195
11 changed files with 95 additions and 36 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue