test for invalid length on random hex
This commit is contained in:
parent
6fd21e4e36
commit
91f7d66dbb
@ -23,7 +23,10 @@ test ('random_hex with default length', (t) => {
|
||||
});
|
||||
|
||||
test ('random_hex should refuse lenght smaller 1', (t) => {
|
||||
t.throws (() => (crypto.random_hex (0)));
|
||||
const error = t.throws (
|
||||
() => (crypto.random_hex (0))
|
||||
);
|
||||
t.is(error.message, 'invalid length');
|
||||
});
|
||||
|
||||
test ('random_string', (t) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user