From f0818c18608bbbaf480f6ce8d71c2250ce6b8901 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 5 Jul 2026 19:43:55 +0200 Subject: [PATCH] Implement a unit test for passing unsupported data types to `MurmurHash3_64.update()` This commit brings the coverage of `src/shared/murmurhash3.js` to 100%. --- test/unit/murmurhash3_spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/unit/murmurhash3_spec.js b/test/unit/murmurhash3_spec.js index ed8777b34e491..fe93a863906e1 100644 --- a/test/unit/murmurhash3_spec.js +++ b/test/unit/murmurhash3_spec.js @@ -43,6 +43,12 @@ describe("MurmurHash3_64", function () { hash.update(new Uint32Array(new Uint8Array(sourceCharCodes).buffer)); expect(hash.hexdigest()).toEqual(hexDigestExpected); }); + it("throws an exception for unsupported input types", function () { + const hash = new MurmurHash3_64(); + expect(() => hash.update(42)).toThrow( + new Error("Invalid data format, must be a string or TypedArray.") + ); + }); it("changes the hash after update without seed", function () { const hash = new MurmurHash3_64();