1
0
mirror of https://github.com/S2-/securerandomstring.git synced 2025-08-02 10:20:05 +02:00

add one more test

This commit is contained in:
s2
2017-11-26 22:04:14 +01:00
parent 0259480474
commit cb6bbee3b1

View File

@@ -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);