diff options
| author | Marak <[email protected]> | 2018-10-28 15:35:22 -0400 |
|---|---|---|
| committer | Marak <[email protected]> | 2018-10-28 15:35:22 -0400 |
| commit | d3ce6f1a2a9359574e7f31f14d4901648047c45a (patch) | |
| tree | 6b48cb7353efea06ea81c156c86689c5cbaf4ca2 /test/random.unit.js | |
| parent | 72dce1198fd348f069b8e42e91ef67b74da1009f (diff) | |
| parent | b5bf3649796c5497f3d89450b6dc12dc5c10bd3d (diff) | |
| download | faker-d3ce6f1a2a9359574e7f31f14d4901648047c45a.tar.xz faker-d3ce6f1a2a9359574e7f31f14d4901648047c45a.zip | |
[api] Added vehicle module #555
Diffstat (limited to 'test/random.unit.js')
| -rw-r--r-- | test/random.unit.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/random.unit.js b/test/random.unit.js index fe46cbf8..cdeb07f1 100644 --- a/test/random.unit.js +++ b/test/random.unit.js @@ -255,6 +255,26 @@ describe("random.js", function () { }); }); + describe('alpha', function() { + var alpha = faker.random.alpha; + + it('should return single letter when no count provided', function() { + assert.ok(alpha().length === 1); + }) + + it('should return lowercase letter when no upcase option provided', function() { + assert.ok(alpha().match(/[a-z]/)); + }) + + it('should return uppercase when upcase option is true', function() { + assert.ok(alpha({ upcase: true }).match(/[A-Z]/)); + }) + + it('should generate many random letters', function() { + assert.ok(alpha(5).length === 5); + }) + }) + describe('alphaNumeric', function() { var alphaNumeric = faker.random.alphaNumeric; |
