From 616354e76cba0be8af20a0ffefeacfcf6101bafc Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 22 Nov 2023 22:11:20 +1100 Subject: refactor: replace `deferred()` from `std/async` with `Promise.withResolvers()` (#21234) Closes #21041 --------- Signed-off-by: Asher Gomez --- cli/tests/unit_node/process_test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cli/tests/unit_node/process_test.ts') diff --git a/cli/tests/unit_node/process_test.ts b/cli/tests/unit_node/process_test.ts index a572f11b2..ffb95413a 100644 --- a/cli/tests/unit_node/process_test.ts +++ b/cli/tests/unit_node/process_test.ts @@ -13,7 +13,6 @@ import { assertThrows, } from "../../../test_util/std/testing/asserts.ts"; import { stripColor } from "../../../test_util/std/fmt/colors.ts"; -import { deferred } from "../../../test_util/std/async/deferred.ts"; import * as path from "../../../test_util/std/path/mod.ts"; import { delay } from "../../../test_util/std/async/delay.ts"; @@ -368,7 +367,7 @@ Deno.test({ // stdin resource is present before the test starts. sanitizeResources: false, async fn() { - const promise = deferred(); + const { promise, resolve } = Promise.withResolvers(); const expected = ["foo", "bar", null, "end"]; const data: (string | null)[] = []; @@ -385,7 +384,7 @@ Deno.test({ process.stdin.push("bar"); process.nextTick(() => { process.stdin.push(null); - promise.resolve(); + resolve(); }); }); -- cgit v1.2.3