From 3ee22065f019d4f37dafb4e11607478fa9bcede5 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Thu, 27 Apr 2023 07:51:30 -0700 Subject: [PATCH] :nail_care: --- test/js/node/crypto/crypto.test.ts | 18 ++++-------------- test/js/node/crypto/node-crypto.test.js | 1 - 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/test/js/node/crypto/crypto.test.ts b/test/js/node/crypto/crypto.test.ts index 3efd4c3171..6c34501cb2 100644 --- a/test/js/node/crypto/crypto.test.ts +++ b/test/js/node/crypto/crypto.test.ts @@ -50,9 +50,7 @@ describe("CryptoHasher", () => { it("CryptoHasher sha256", () => { var hasher = new CryptoHasher("sha256"); hasher.update("hello world"); - expect(hasher.digest("hex")).toBe( - "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9", - ); + expect(hasher.digest("hex")).toBe("b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"); expect(hasher.algorithm).toBe("sha256"); }); @@ -60,22 +58,16 @@ describe("CryptoHasher", () => { var hasher = new CryptoHasher("sha256"); hasher.update("hello "); hasher.update("world"); - expect(hasher.digest("hex")).toBe( - "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9", - ); + expect(hasher.digest("hex")).toBe("b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"); expect(hasher.algorithm).toBe("sha256"); }); it("CryptoHasher resets when digest is called", () => { var hasher = new CryptoHasher("sha256"); hasher.update("hello"); - expect(hasher.digest("hex")).toBe( - "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", - ); + expect(hasher.digest("hex")).toBe("2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"); hasher.update("world"); - expect(hasher.digest("hex")).toBe( - "486ea46224d1bb4fb680f34f7c9ad96a8f24ec88be73ea8e5a6c65260e9cb8a7", - ); + expect(hasher.digest("hex")).toBe("486ea46224d1bb4fb680f34f7c9ad96a8f24ec88be73ea8e5a6c65260e9cb8a7"); }); for (let alg of CryptoHasher.algorithms) { @@ -88,7 +80,6 @@ describe("CryptoHasher", () => { expect(copy.algorithm).toBe(orig.algorithm); }); - it(`CryptoHasher ${alg} copy is not linked`, () => { const orig = new CryptoHasher(alg); orig.update("hello"); @@ -98,7 +89,6 @@ describe("CryptoHasher", () => { expect(copy.digest("hex")).not.toBe(orig.digest("hex")); }); - it(`CryptoHasher ${alg} copy updates the same`, () => { const orig = new CryptoHasher(alg); orig.update("hello"); diff --git a/test/js/node/crypto/node-crypto.test.js b/test/js/node/crypto/node-crypto.test.js index 9bed5a47b3..7811d66070 100644 --- a/test/js/node/crypto/node-crypto.test.js +++ b/test/js/node/crypto/node-crypto.test.js @@ -68,7 +68,6 @@ describe("createHash", () => { s.end(); }); - it("repeated calls doesnt segfault", () => { function fn() { crypto.createHash("sha1").update(Math.random(), "ascii").digest("base64");