summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/process_test.ts
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2023-11-22 22:11:20 +1100
committerGitHub <noreply@github.com>2023-11-22 12:11:20 +0100
commit616354e76cba0be8af20a0ffefeacfcf6101bafc (patch)
treec832c81dd93498e196840c8d59c0a4ab76396d07 /cli/tests/unit_node/process_test.ts
parent0ffcb46e0f60110c07e21151db6066f5a1b5f710 (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/process_test.ts')
-rw-r--r--cli/tests/unit_node/process_test.ts5
1 files changed, 2 insertions, 3 deletions
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<void>();
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();
});
});