diff options
| author | Marak <[email protected]> | 2021-02-04 17:29:55 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-04 17:29:55 -0500 |
| commit | cdcb600957650a84ebf70a6267add4b41371a3f3 (patch) | |
| tree | 6d8b4fc57bfa90688dc65db40e1bd9c828258891 /test | |
| parent | 639a5256a259066b3619423d89edf6675c674293 (diff) | |
| parent | ad391be8444882af92519ac7a4c4d784818b0193 (diff) | |
| download | faker-cdcb600957650a84ebf70a6267add4b41371a3f3.tar.xz faker-cdcb600957650a84ebf70a6267add4b41371a3f3.zip | |
Merge branch 'master' into nl-locale-weekdays
Diffstat (limited to 'test')
| -rw-r--r-- | test/finance.unit.js | 2 | ||||
| -rw-r--r-- | test/internet.unit.js | 8 | ||||
| -rw-r--r-- | test/random.unit.js | 6 | ||||
| -rw-r--r-- | test/vehicle.unit.js | 10 |
4 files changed, 25 insertions, 1 deletions
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}$/)); }); }); 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(); 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(); 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(); + }); + }); }); |
