aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/js/node/crypto/crypto.test.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/js/node/crypto/crypto.test.ts b/test/js/node/crypto/crypto.test.ts
index d03940b9f..d8bfe5353 100644
--- a/test/js/node/crypto/crypto.test.ts
+++ b/test/js/node/crypto/crypto.test.ts
@@ -88,6 +88,15 @@ describe("CryptoHasher", () => {
expect(copy.digest("hex")).not.toBe(orig.digest("hex"));
});
+ it(`CryptoHasher ${alg} copy can be used after digest()`, () => {
+ const orig = new CryptoHasher(alg);
+ orig.update("hello");
+ orig.digest("hex");
+ const copy = orig.copy();
+
+ expect(() => copy.digest("hex")).not.toThrow();
+ });
+
it(`CryptoHasher ${alg} copy updates the same`, () => {
const orig = new CryptoHasher(alg);
orig.update("hello");