From d2fa3e61e9f0e5260c6d54a15ae1f71fe3e1e4dc Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 22 Nov 2018 06:34:53 +0700 Subject: [PATCH] Test throws on invalid bit length --- test/unit.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/unit.js b/test/unit.js index 60834d9..225e57a 100644 --- a/test/unit.js +++ b/test/unit.js @@ -29,3 +29,13 @@ test('Bit length is configurable', t => { t.is(dogeSeed(224).split(' ').length, 21); t.is(dogeSeed(256).split(' ').length, 24); }); + +test('Throws on invalid bit length', t => { + t.throws(() => dogeSeed(-1)); + t.throws(() => dogeSeed(0)); + t.throws(() => dogeSeed(1)); + t.throws(() => dogeSeed(1.5)); + t.throws(() => dogeSeed(129)); + t.throws(() => dogeSeed(219.5)); + t.throws(() => dogeSeed(512)); +});