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.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/cli/tests/unit_node/internal/scrypt_test.ts b/cli/tests/unit_node/internal/scrypt_test.ts
index e98a1a3af..d65cd27ff 100644
--- a/cli/tests/unit_node/internal/scrypt_test.ts
+++ b/cli/tests/unit_node/internal/scrypt_test.ts
@@ -2,8 +2,11 @@
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();
-Deno.test("scrypt works correctly", () => {
scrypt("password", "salt", 32, (err, key) => {
if (err) throw err;
assertEquals(
@@ -43,10 +46,15 @@ Deno.test("scrypt works correctly", () => {
115,
]),
);
+ promise.resolve(true);
});
+
+ await promise;
});
-Deno.test("scrypt works with options", () => {
+Deno.test("scrypt works with options", async () => {
+ const promise = deferred();
+
scrypt(
"password",
"salt",
@@ -93,8 +101,11 @@ Deno.test("scrypt works with options", () => {
71,
]),
);
+ promise.resolve(true);
},
);
+
+ await promise;
});
Deno.test("scryptSync works correctly", () => {