aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuiz Strobelt <[email protected]>2020-10-04 17:09:34 -0300
committerLuiz Strobelt <[email protected]>2020-10-04 17:09:34 -0300
commit51ec3946aa9644259c54e346bc58756543f679dd (patch)
tree1b8039b630b9a3959a8ec080b91974bb8aac691d /test
parent5df3678f842383855c53a4c14d39a20deb64f7cc (diff)
downloadfaker-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.js6
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();