mirror of
https://github.com/S2-/securerandomstring.git
synced 2025-08-03 02:40:04 +02:00
Fix error in options name
* Change Readme.md fixing alphabetic by alphanumeric name of options * Add test to new option alphanumeric always expect alphanumeric chars if 'alphanumeric' options is true
This commit is contained in:
7
tests.js
7
tests.js
@@ -50,7 +50,12 @@ srs({length: 256}, function(err, sr) {
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
srs({alphanumeric: true}, function(err, sr) {;
|
||||
test('Must contain alphanumeric only',
|
||||
sr.match(/^[a-zA-Z0-9_]*$/g)[0] === sr,
|
||||
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);
|
||||
|
Reference in New Issue
Block a user