diff options
author | Levente Kurusa <lkurusa@kernelstuff.org> | 2023-04-18 14:29:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 14:29:10 +0200 |
commit | 530963c34c5cc5260b07029fff6c4ae85f52d830 (patch) | |
tree | 2eb88362f222610f9bd934e7627d8928e630cc98 /cli/tests | |
parent | 74aee8b3058f1c32f367fced8f8a33e7d0aff38c (diff) |
refactor(node/crypto): scrypt polyfill to rust (#18746)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit_node/internal/scrypt_test.ts | 15 |
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", () => { |