From b93bdbb124fc7b1b4a09d414158e0107e8d66b92 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Tue, 13 Jun 2023 07:29:02 -0700 Subject: [PATCH] Add test --- test/js/node/crypto/node-crypto.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/js/node/crypto/node-crypto.test.js b/test/js/node/crypto/node-crypto.test.js index 7811d66070..9e0e7f3969 100644 --- a/test/js/node/crypto/node-crypto.test.js +++ b/test/js/node/crypto/node-crypto.test.js @@ -16,6 +16,12 @@ describe("createHash", () => { expect(hash.digest("hex")).toBe("6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50"); }); + it("returns Buffer", () => { + const hash = crypto.createHash("sha256"); + hash.update("some data to hash"); + expect(Buffer.isBuffer(hash.digest())).toBeTrue(); + }); + it("stream (sync)", () => { const hash = crypto.createHash("sha256"); hash.write("some data to hash");