diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2023-11-22 22:11:20 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-22 12:11:20 +0100 |
commit | 616354e76cba0be8af20a0ffefeacfcf6101bafc (patch) | |
tree | c832c81dd93498e196840c8d59c0a4ab76396d07 /cli/tests/unit_node/tls_test.ts | |
parent | 0ffcb46e0f60110c07e21151db6066f5a1b5f710 (diff) |
refactor: replace `deferred()` from `std/async` with `Promise.withResolvers()` (#21234)
Closes #21041
---------
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Diffstat (limited to 'cli/tests/unit_node/tls_test.ts')
-rw-r--r-- | cli/tests/unit_node/tls_test.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/tests/unit_node/tls_test.ts b/cli/tests/unit_node/tls_test.ts index 7a270c60b..0a3a91144 100644 --- a/cli/tests/unit_node/tls_test.ts +++ b/cli/tests/unit_node/tls_test.ts @@ -5,7 +5,6 @@ import { assertInstanceOf, } from "../../../test_util/std/testing/asserts.ts"; import { delay } from "../../../test_util/std/async/delay.ts"; -import { deferred } from "../../../test_util/std/async/deferred.ts"; import { fromFileUrl, join } from "../../../test_util/std/path/mod.ts"; import { serveTls } from "../../../test_util/std/http/server.ts"; import * as tls from "node:tls"; @@ -89,7 +88,7 @@ Deno.test("tls.connect mid-read tcp->tls upgrade", async () => { }); Deno.test("tls.createServer creates a TLS server", async () => { - const p = deferred(); + const deferred = Promise.withResolvers<void>(); const server = tls.createServer( // deno-lint-ignore no-explicit-any { host: "0.0.0.0", key, cert } as any, @@ -131,9 +130,9 @@ Deno.test("tls.createServer creates a TLS server", async () => { conn.close(); server.close(); - p.resolve(); + deferred.resolve(); }); - await p; + await deferred.promise; }); Deno.test("TLSSocket can construct without options", () => { |