From cb6bbee3b1f7bb581862dbfe19d25d8d61f1adae Mon Sep 17 00:00:00 2001 From: s2 Date: Sun, 26 Nov 2017 22:04:14 +0100 Subject: [PATCH] add one more test --- tests.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests.js b/tests.js index a830322..5228a28 100644 --- a/tests.js +++ b/tests.js @@ -56,6 +56,14 @@ srs({alphanumeric: true}, function(err, sr) {; true ); }); + +srs({alphanumeric: true, length: 40}, function(err, sr) {; + test('Must contain alphanumeric only and be 40 chars long', + sr.match(/^[a-zA-Z0-9_]*$/g)[0] === sr && sr.length === 40, + true + ); +}); + // sync tests test('generate a random string 32 chars long (sync)', srs().length, 32); test('generate a random string 1 chars long (sync)', srs({length: 1}).length, 1);