From e470b68ea57a85a3287afd67995c12cc3c5698aa Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Mon, 9 Mar 2020 08:14:55 +0100 Subject: [PATCH] fix test for zero length random string --- test/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index e1c4753..c56ef71 100644 --- a/test/index.js +++ b/test/index.js @@ -40,7 +40,10 @@ test ('random_string with default length', (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) => {