mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 21:24:48 +00:00
refactor: replace deferred()
from std/async
with Promise.withResolvers()
(#21234)
Closes #21041 --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
parent
0ffcb46e0f
commit
616354e76c
35 changed files with 952 additions and 1020 deletions
|
@ -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", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue