test for invalid length on random hex
This commit is contained in:
		| @@ -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) => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user