diff options
| author | Luiz Strobelt <[email protected]> | 2020-10-04 17:09:34 -0300 |
|---|---|---|
| committer | Luiz Strobelt <[email protected]> | 2020-10-04 17:09:34 -0300 |
| commit | 51ec3946aa9644259c54e346bc58756543f679dd (patch) | |
| tree | 1b8039b630b9a3959a8ec080b91974bb8aac691d /test | |
| parent | 5df3678f842383855c53a4c14d39a20deb64f7cc (diff) | |
| download | faker-51ec3946aa9644259c54e346bc58756543f679dd.tar.xz faker-51ec3946aa9644259c54e346bc58756543f679dd.zip | |
Check if seed is a number or array before seeding faker.random
Diffstat (limited to 'test')
| -rw-r--r-- | test/random.unit.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/random.unit.js b/test/random.unit.js index cdeb07f1..39ef4a0f 100644 --- a/test/random.unit.js +++ b/test/random.unit.js @@ -85,6 +85,12 @@ describe("random.js", function () { assert.equal(name, 'Eva Jenkins'); }) + it('should return deterministic results when seeded with 0', function() { + faker.seed(0); + var name = faker.name.findName(); + assert.strictEqual(name, 'Lola Sporer'); + }) + it('should return deterministic results when seeded with array - one element', function() { faker.seed([10]); var name = faker.name.findName(); |
