From 99824049fc20314be286c206c11b7a4d7d7a43b2 Mon Sep 17 00:00:00 2001 From: scarabedore Date: Fri, 18 Sep 2020 17:52:16 +0200 Subject: added faker.internet.port --- test/internet.unit.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/internet.unit.js b/test/internet.unit.js index a554cea0..eb99eb7d 100644 --- a/test/internet.unit.js +++ b/test/internet.unit.js @@ -154,6 +154,14 @@ describe("internet.js", function () { }); }); + describe("port()", function () { + it("returns a random port number", function () { + var port = faker.internet.port(); + assert.ok(Number.isInteger(port)); + assert.ok(0 <= port && port <= 65535); + }); + }); + describe("userAgent()", function () { it("returns a valid user-agent", function () { var ua = faker.internet.userAgent(); -- cgit v1.2.3 From 51ec3946aa9644259c54e346bc58756543f679dd Mon Sep 17 00:00:00 2001 From: Luiz Strobelt Date: Sun, 4 Oct 2020 17:09:34 -0300 Subject: Check if seed is a number or array before seeding faker.random --- test/random.unit.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') 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(); -- cgit v1.2.3 From 0108e3deabab280f79b8d0df5488bb9b13199d01 Mon Sep 17 00:00:00 2001 From: Andy Coupe Date: Wed, 18 Nov 2020 21:44:30 +0000 Subject: add vrm and test --- test/vehicle.unit.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/vehicle.unit.js b/test/vehicle.unit.js index 1d9802e8..3df2e656 100644 --- a/test/vehicle.unit.js +++ b/test/vehicle.unit.js @@ -61,4 +61,14 @@ describe("vehicle.js", function () { faker.vehicle.color.restore(); }); }); + + describe("vrm()", function () { + it("returns a random vrm", function () { + sinon.stub(faker.vehicle, 'vrm').returns('MF59EEW'); + var vrm = faker.vehicle.vrm(); + + assert.equal(vrm, 'MF59EEW'); + faker.vehicle.vrm.restore(); + }); + }); }); -- cgit v1.2.3 From 4bf052067485848a21a81a5fdcf866e4d8071a3f Mon Sep 17 00:00:00 2001 From: Andy Coupe Date: Sun, 22 Nov 2020 07:27:33 +0000 Subject: fix broken finance test --- test/finance.unit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/finance.unit.js b/test/finance.unit.js index 8935eaaa..0e5e6624 100644 --- a/test/finance.unit.js +++ b/test/finance.unit.js @@ -259,7 +259,7 @@ describe('finance.js', function () { it("returns a random litecoin address", function(){ var litecoinAddress = faker.finance.litecoinAddress(); - assert.ok(litecoinAddress.match(/^[LM3][a-km-zA-HJ-NP-Z1-9]{26,33}$/)); + assert.ok(litecoinAddress.match(/^[LM3][1-9a-km-zA-HJ-NP-Z]{25,32}$/)); }); }); -- cgit v1.2.3