diff options
author | 2023-04-27 07:51:30 -0700 | |
---|---|---|
committer | 2023-04-27 07:51:30 -0700 | |
commit | 3ee22065f019d4f37dafb4e11607478fa9bcede5 (patch) | |
tree | dcf5bc7a50405f7ea8f9955a7e202baf28338bef | |
parent | 0060e499235a88693d2b884f5067afa9d4a5793f (diff) | |
download | bun-3ee22065f019d4f37dafb4e11607478fa9bcede5.tar.gz bun-3ee22065f019d4f37dafb4e11607478fa9bcede5.tar.zst bun-3ee22065f019d4f37dafb4e11607478fa9bcede5.zip |
:nail_care:
-rw-r--r-- | test/js/node/crypto/crypto.test.ts | 18 | ||||
-rw-r--r-- | 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 3efd4c317..6c34501cb 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 9bed5a47b..7811d6607 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"); |