Browse Source

add one more test

tags/v1.1.2
s2 2 years ago
parent
commit
cb6bbee3b1
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      tests.js

+ 8
- 0
tests.js 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);


Loading…
Cancel
Save