- Added TypeScript definitions.

- Changed throw error if update after finalize
This commit is contained in:
Yi-Cyuan Chen
2018-08-05 15:33:12 +08:00
parent 1c00d97268
commit b39d0910cb
10 changed files with 177 additions and 22 deletions
+11 -1
View File
@@ -264,7 +264,7 @@
call: function (message) {
var hash = algorithm.update(message);
hash.hex();
hash.update(message);
hash.finalize();
return hash.hex();
}
}
@@ -321,6 +321,16 @@
});
});
});
context('when update after finalize', function () {
it('should throw error', function () {
expect(function () {
var hash = algorithm.update('any');
hash.hex();
hash.update('any');
}).to.throwError(/finalize already called/);
});
});
});
});
}