summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/internal/scrypt_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit_node/internal/scrypt_test.ts')
-rw-r--r--cli/tests/unit_node/internal/scrypt_test.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/cli/tests/unit_node/internal/scrypt_test.ts b/cli/tests/unit_node/internal/scrypt_test.ts
index d65cd27ff..83830f8e4 100644
--- a/cli/tests/unit_node/internal/scrypt_test.ts
+++ b/cli/tests/unit_node/internal/scrypt_test.ts
@@ -2,10 +2,9 @@
import { scrypt, scryptSync } from "node:crypto";
import { Buffer } from "node:buffer";
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
-import { deferred } from "../../../../test_util/std/async/deferred.ts";
Deno.test("scrypt works correctly", async () => {
- const promise = deferred();
+ const { promise, resolve } = Promise.withResolvers<boolean>();
scrypt("password", "salt", 32, (err, key) => {
if (err) throw err;
@@ -46,14 +45,14 @@ Deno.test("scrypt works correctly", async () => {
115,
]),
);
- promise.resolve(true);
+ resolve(true);
});
await promise;
});
Deno.test("scrypt works with options", async () => {
- const promise = deferred();
+ const { promise, resolve } = Promise.withResolvers<boolean>();
scrypt(
"password",
@@ -101,7 +100,7 @@ Deno.test("scrypt works with options", async () => {
71,
]),
);
- promise.resolve(true);
+ resolve(true);
},
);