fix test for zero length random string

This commit is contained in:
Timo Hocker 2020-03-09 08:14:55 +01:00
parent 59476a8087
commit e470b68ea5

View File

@ -40,7 +40,10 @@ test ('random_string with default length', (t) => {
}); });
test ('random_string should refuse lenght smaller 1', (t) => { test ('random_string should refuse lenght smaller 1', (t) => {
t.throws (() => (crypto.random_string (0))); const error = t.throws (
() => (crypto.random_string (0))
);
t.is(error.message, 'invalid length');
}); });
test ('hash_sha512', (t) => { test ('hash_sha512', (t) => {