From 91f7d66dbb466d077776eefd39989d6366ffff50 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Mon, 9 Mar 2020 07:58:26 +0100 Subject: [PATCH] test for invalid length on random hex --- test/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index e817d12..e1c4753 100644 --- a/test/index.js +++ b/test/index.js @@ -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) => {