diff options
Diffstat (limited to 'cli/tests/unit_node/async_hooks_test.ts')
-rw-r--r-- | cli/tests/unit_node/async_hooks_test.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cli/tests/unit_node/async_hooks_test.ts b/cli/tests/unit_node/async_hooks_test.ts index 871ad85f9..035e970d4 100644 --- a/cli/tests/unit_node/async_hooks_test.ts +++ b/cli/tests/unit_node/async_hooks_test.ts @@ -4,7 +4,6 @@ import { assert, assertEquals, } from "../../../test_util/std/testing/asserts.ts"; -import { deferred } from "../../../test_util/std/async/deferred.ts"; Deno.test(async function foo() { const asyncLocalStorage = new AsyncLocalStorage(); @@ -68,16 +67,16 @@ Deno.test(async function bar() { Deno.test(async function nested() { const als = new AsyncLocalStorage(); - const promise = deferred(); - const promise1 = deferred(); + const deferred = Promise.withResolvers(); + const deferred1 = Promise.withResolvers(); als.run(null, () => { als.run({ x: 1 }, () => { - promise.resolve(als.getStore()); + deferred.resolve(als.getStore()); }); - promise1.resolve(als.getStore()); + deferred1.resolve(als.getStore()); }); - assertEquals(await promise, { x: 1 }); - assertEquals(await promise1, null); + assertEquals(await deferred.promise, { x: 1 }); + assertEquals(await deferred1.promise, null); }); |