aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarlos Carvalho <[email protected]>2020-10-04 02:05:11 -0300
committerCarlos Carvalho <[email protected]>2020-10-04 02:05:11 -0300
commit2a938bd11b781f61718e2ddfb8a6419002d9e757 (patch)
treed92c13067ee09c7e9e9cf7d5d22aff3b49c9262f /test
parent91dc8a3372426bc691be56153b33e81a16459f49 (diff)
downloadfaker-2a938bd11b781f61718e2ddfb8a6419002d9e757.tar.xz
faker-2a938bd11b781f61718e2ddfb8a6419002d9e757.zip
Change deprecated assert.equal
Diffstat (limited to 'test')
-rw-r--r--test/address.unit.js77
-rw-r--r--test/commerce.unit.js10
-rw-r--r--test/database.unit.js12
-rw-r--r--test/finance.unit.js30
-rw-r--r--test/helpers.unit.js14
-rw-r--r--test/image.unit.js82
-rw-r--r--test/internet.unit.js12
-rw-r--r--test/locales.unit.js2
-rw-r--r--test/lorem.unit.js28
-rw-r--r--test/music.unit.js2
-rw-r--r--test/name.unit.js24
-rw-r--r--test/random.unit.js30
-rw-r--r--test/system.unit.js8
-rw-r--r--test/unique.unit.js8
-rw-r--r--test/vehicle.unit.js10
15 files changed, 189 insertions, 160 deletions
diff --git a/test/address.unit.js b/test/address.unit.js
index dbd6cca6..570e5036 100644
--- a/test/address.unit.js
+++ b/test/address.unit.js
@@ -115,6 +115,11 @@ describe("address.js", function () {
describe("streetAddress()", function () {
+
+ var errorExpectDigits = function(expected){
+ return "The street number should be had " + expected + " digits"
+ }
+
beforeEach(function () {
sinon.spy(faker.address, 'streetName');
sinon.spy(faker.address, 'secondaryAddress');
@@ -128,9 +133,10 @@ describe("address.js", function () {
it("occasionally returns a 5-digit street number", function () {
sinon.stub(faker.random, 'number').returns(0);
var address = faker.address.streetAddress();
+ var expected = 5
var parts = address.split(' ');
- assert.equal(parts[0].length, 5);
+ assert.strictEqual(parts[0].length, expected, errorExpectDigits(expected));
assert.ok(faker.address.streetName.called);
faker.random.number.restore();
@@ -140,8 +146,9 @@ describe("address.js", function () {
sinon.stub(faker.random, 'number').returns(1);
var address = faker.address.streetAddress();
var parts = address.split(' ');
+ var expected = 4
- assert.equal(parts[0].length, 4);
+ assert.strictEqual(parts[0].length, expected, errorExpectDigits(expected));
assert.ok(faker.address.streetName.called);
faker.random.number.restore();
@@ -151,8 +158,9 @@ describe("address.js", function () {
sinon.stub(faker.random, 'number').returns(2);
var address = faker.address.streetAddress();
var parts = address.split(' ');
+ var expected = 3
- assert.equal(parts[0].length, 3);
+ assert.strictEqual(parts[0].length, expected, errorExpectDigits(expected));
assert.ok(faker.address.streetName.called);
assert.ok(!faker.address.secondaryAddress.called);
@@ -161,9 +169,8 @@ describe("address.js", function () {
context("when useFulladdress is true", function () {
it("adds a secondary address to the result", function () {
- var address = faker.address.streetAddress(true);
- var parts = address.split(' ');
-
+ faker.address.streetAddress(true);
+
assert.ok(faker.address.secondaryAddress.called);
});
});
@@ -222,7 +229,7 @@ describe("address.js", function () {
var countryCode = faker.address.countryCode("alpha-3");
assert.ok(countryCode);
assert.ok(faker.address.countryCode.called);
- assert.equal(countryCode.length, 3);
+ assert.strictEqual(countryCode.length, 3, "The countryCode should be had 3 characters");
faker.address.countryCode.restore();
});
@@ -282,7 +289,7 @@ describe("address.js", function () {
it("returns undefined if state is invalid", function () {
var state = "XX";
sinon.spy(faker.address, 'zipCode');
- var zipCode = faker.address.zipCodeByState(state);
+ faker.address.zipCodeByState(state);
assert.ok(faker.address.zipCode.called);
faker.address.zipCode.restore();
});
@@ -291,7 +298,7 @@ describe("address.js", function () {
faker.locale = "zh_CN";
var state = "IL";
sinon.spy(faker.address, 'zipCode');
- var zipCode = faker.address.zipCodeByState(state);
+ faker.address.zipCodeByState(state);
assert.ok(faker.address.zipCode.called);
faker.address.zipCode.restore();
});
@@ -316,7 +323,7 @@ describe("address.js", function () {
sinon.spy(faker.random, 'number');
var latitude = faker.address.latitude(-5, 5);
assert.ok(typeof latitude === 'string');
- assert.equal(latitude.split('.')[1].length, 4);
+ assert.strictEqual(latitude.split('.')[1].length, 4, "The precision of latitude should be had of 4 digits");
var latitude_float = parseFloat(latitude);
assert.ok(latitude_float >= -5);
assert.ok(latitude_float <= 5);
@@ -330,7 +337,7 @@ describe("address.js", function () {
sinon.spy(faker.random, 'number');
var latitude = faker.address.latitude(undefined, undefined, 7);
assert.ok(typeof latitude === 'string');
- assert.equal(latitude.split('.')[1].length, 7);
+ assert.strictEqual(latitude.split('.')[1].length, 7, "The precision of latitude should be had of 7 digits");
var latitude_float = parseFloat(latitude);
assert.ok(latitude_float >= -180);
assert.ok(latitude_float <= 180);
@@ -359,7 +366,7 @@ describe("address.js", function () {
sinon.spy(faker.random, 'number');
var longitude = faker.address.longitude(100, -30);
assert.ok(typeof longitude === 'string');
- assert.equal(longitude.split('.')[1].length, 4);
+ assert.strictEqual(longitude.split('.')[1].length, 4, "The precision of longitude should be had of 4 digits");
var longitude_float = parseFloat(longitude);
assert.ok(longitude_float >= -30);
assert.ok(longitude_float <= 100);
@@ -373,7 +380,7 @@ describe("address.js", function () {
sinon.spy(faker.random, 'number');
var longitude = faker.address.longitude(undefined, undefined, 7);
assert.ok(typeof longitude === 'string');
- assert.equal(longitude.split('.')[1].length, 7);
+ assert.strictEqual(longitude.split('.')[1].length, 7, "The precision of longitude should be had of 7 digits");
var longitude_float = parseFloat(longitude);
assert.ok(longitude_float >= -180);
assert.ok(longitude_float <= 180);
@@ -387,28 +394,34 @@ describe("address.js", function () {
it("returns random direction", function () {
sinon.stub(faker.address, 'direction').returns('North');
var direction = faker.address.direction();
+ var expected = 'North';
- assert.equal(direction, 'North');
+ assert.strictEqual(direction, expected, "The random direction should be equals " + expected);
faker.address.direction.restore();
})
it("returns abbreviation when useAbbr is false", function () {
sinon.stub(faker.address, 'direction').returns('N');
var direction = faker.address.direction(false);
- assert.equal(direction, 'N');
+ var expected = 'N';
+ assert.strictEqual(direction, expected, "The abbreviation of direction when useAbbr is false should be equals " + expected+ ". Actual is " + direction);
faker.address.direction.restore();
})
it("returns abbreviation when useAbbr is true", function () {
var direction = faker.address.direction(true);
- assert.equal(typeof direction, 'string');
- assert.equal(direction.length <= 2, true);
+ var expectedType = 'string';
+ var lengthDirection = direction.length
+ var prefixErrorMessage = "The abbreviation of direction when useAbbr is true should"
+ assert.strictEqual(typeof direction, expectedType, prefixErrorMessage + " be typeof string. Actual is" + typeof direction);
+ assert.strictEqual(lengthDirection <= 2, true, prefixErrorMessage + " have a length less or equals 2. Actual is " + lengthDirection);
})
it("returns abbreviation when useAbbr is true", function () {
sinon.stub(faker.address, 'direction').returns('N');
var direction = faker.address.direction(true);
- assert.equal(direction, 'N');
+ var expected = 'N';
+ assert.strictEqual(direction, expected, "The abbreviation of direction when useAbbr is true should be equals " + expected + ". Actual is " + direction);
faker.address.direction.restore();
})
@@ -418,23 +431,29 @@ describe("address.js", function () {
it("returns random ordinal direction", function () {
sinon.stub(faker.address, 'ordinalDirection').returns('West');
var ordinalDirection = faker.address.ordinalDirection();
+ var expected = 'West';
- assert.equal(ordinalDirection, 'West');
+ assert.strictEqual(ordinalDirection, expected, "The ransom ordinal direction should be equals " + expected + ". Actual is " + ordinalDirection);
faker.address.ordinalDirection.restore();
})
it("returns abbreviation when useAbbr is true", function () {
sinon.stub(faker.address, 'ordinalDirection').returns('W');
var ordinalDirection = faker.address.ordinalDirection(true);
+ var expected = 'W';
- assert.equal(ordinalDirection, 'W');
+ assert.strictEqual(ordinalDirection, expected, "The ordinal direction when useAbbr is true should be equals " + expected + ". Actual is " + ordinalDirection);
faker.address.ordinalDirection.restore();
})
it("returns abbreviation when useAbbr is true", function () {
var ordinalDirection = faker.address.ordinalDirection(true);
- assert.equal(typeof ordinalDirection, 'string');
- assert.equal(ordinalDirection.length <= 2, true);
+ var expectedType = 'string';
+ var ordinalDirectionLength = ordinalDirection.length;
+ var prefixErrorMessage = "The ordinal direction when useAbbr is true should"
+
+ assert.strictEqual(typeof ordinalDirection, expectedType, prefixErrorMessage + " be had typeof equals " + expectedType + ".Actual is " + typeof ordinalDirection);
+ assert.strictEqual(ordinalDirectionLength <= 2, true, prefixErrorMessage + " have a length less or equals 2. Actual is " + ordinalDirectionLength);
})
@@ -444,23 +463,29 @@ describe("address.js", function () {
it("returns random cardinal direction", function () {
sinon.stub(faker.address, 'cardinalDirection').returns('Northwest');
var cardinalDirection = faker.address.cardinalDirection();
+ var expected = 'Northwest';
- assert.equal(cardinalDirection, 'Northwest');
+ assert.strictEqual(cardinalDirection, expected, "The random cardinal direction should be equals " + expected + ". Actual is " + cardinalDirection);
faker.address.cardinalDirection.restore();
})
it("returns abbreviation when useAbbr is true", function () {
sinon.stub(faker.address, 'cardinalDirection').returns('NW');
var cardinalDirection = faker.address.cardinalDirection(true);
+ var expected = 'NW';
- assert.equal(cardinalDirection, 'NW');
+ assert.strictEqual(cardinalDirection, expected, "The cardinal direction when useAbbr is true should be equals " + expected + ". Actual is " + cardinalDirection);
faker.address.cardinalDirection.restore();
})
it("returns abbreviation when useAbbr is true", function () {
var cardinalDirection = faker.address.cardinalDirection(true);
- assert.equal(typeof cardinalDirection, 'string');
- assert.equal(cardinalDirection.length <= 2, true);
+ var expectedType = 'string';
+ var cardinalDirectionLength = cardinalDirection.length;
+ var prefixErrorMessage = "The cardinal direction when useAbbr is true should"
+
+ assert.strictEqual(typeof cardinalDirection, expectedType, prefixErrorMessage + " be had typeof equals " + expectedType + ".Actual is " + typeof ordinalDirection);
+ assert.strictEqual(cardinalDirectionLength <= 2, true, prefixErrorMessage + " have a length less or equals 2. Actual is " + cardinalDirectionLength);
})
})
diff --git a/test/commerce.unit.js b/test/commerce.unit.js
index 04d4277e..61161e07 100644
--- a/test/commerce.unit.js
+++ b/test/commerce.unit.js
@@ -77,8 +77,8 @@ describe("commerce.js", function() {
var price = faker.commerce.price();
assert.ok(price);
- assert.equal((price > 0), true, "the amount should be greater than 0");
- assert.equal((price < 1001), true, "the amount should be less than 1000");
+ assert.strictEqual((price > 0), true, "the amount should be greater than 0");
+ assert.strictEqual((price < 1001), true, "the amount should be less than 1000");
});
it("should use the default decimal location when not passing arguments", function() {
@@ -88,7 +88,7 @@ describe("commerce.js", function() {
var expected = price.length - 3;
var actual = price.indexOf(decimal);
- assert.equal(actual, expected, "The expected location of the decimal is " + expected + " but it was " + actual + " amount " + price);
+ assert.strictEqual(actual, expected, "The expected location of the decimal is " + expected + " but it was " + actual + " amount " + price);
});
it("should not include a currency symbol by default", function () {
@@ -100,7 +100,7 @@ describe("commerce.js", function() {
var expected = true;
var actual = regexp.test(amount);
- assert.equal(actual, expected, 'The expected match should not include a currency symbol');
+ assert.strictEqual(actual, expected, 'The expected match should not include a currency symbol');
});
it("it should handle negative amounts, but return 0", function () {
@@ -108,7 +108,7 @@ describe("commerce.js", function() {
var amount = faker.commerce.price(-200, -1);
assert.ok(amount);
- assert.equal((amount == 0.00), true, "the amount should equal 0");
+ assert.strictEqual((amount == 0.00), true, "the amount should equal 0");
});
it("it should handle argument dec", function () {
diff --git a/test/database.unit.js b/test/database.unit.js
index bb0cd2a5..57e12325 100644
--- a/test/database.unit.js
+++ b/test/database.unit.js
@@ -9,8 +9,9 @@ describe("database.js", function () {
it("returns a column name", function () {
sinon.stub(faker.database, 'column').returns('title');
var column = faker.database.column();
+ var expected = 'title';
- assert.equal(column, 'title');
+ assert.strictEqual(column, expected, "The column name should be equals " + expected + ". Actual is " + column);
faker.database.column.restore();
});
});
@@ -19,8 +20,9 @@ describe("database.js", function () {
it("returns a collation", function () {
sinon.stub(faker.database, 'collation').returns('utf8_bin');
var collation = faker.database.collation();
+ var expected = 'utf8_bin';
- assert.equal(collation, 'utf8_bin');
+ assert.strictEqual(collation, expected, "The collation should be equals " + expected + ". Actual is " + collation);
faker.database.collation.restore();
});
});
@@ -29,8 +31,9 @@ describe("database.js", function () {
it("returns an engine", function () {
sinon.stub(faker.database, 'engine').returns('InnoDB');
var engine = faker.database.engine();
+ var expected = 'InnoDB';
- assert.equal(engine, 'InnoDB');
+ assert.strictEqual(engine, expected, "The db engine should be equals " + expected + ". Actual is " + engine);
faker.database.engine.restore();
});
});
@@ -39,8 +42,9 @@ describe("database.js", function () {
it("returns a column type", function () {
sinon.stub(faker.database, 'type').returns('int');
var type = faker.database.type();
+ var expected = 'int';
- assert.equal(type, 'int');
+ assert.strictEqual(type, expected, "The column type should be equals " + expected + ". Actual is " + type);
faker.database.type.restore();
});
});
diff --git a/test/finance.unit.js b/test/finance.unit.js
index 8935eaaa..b85ec805 100644
--- a/test/finance.unit.js
+++ b/test/finance.unit.js
@@ -16,7 +16,7 @@ describe('finance.js', function () {
var expected = 8;
var actual = account.length;
- assert.equal(actual, expected, 'The expected default account length is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected default account length is ' + expected + ' but it was ' + actual);
});
@@ -28,7 +28,7 @@ describe('finance.js', function () {
var actual = account.length;
- assert.equal(actual, expected, 'The expected default account length is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected default account length is ' + expected + ' but it was ' + actual);
});
@@ -40,7 +40,7 @@ describe('finance.js', function () {
var actual = account.length;
- assert.equal(actual, expected, 'The expected default account length is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected default account length is ' + expected + ' but it was ' + actual);
});
@@ -79,7 +79,7 @@ describe('finance.js', function () {
var actual = mask.length;
- assert.equal(actual, expected, 'The expected default mask length is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected default mask length is ' + expected + ' but it was ' + actual);
});
@@ -93,7 +93,7 @@ describe('finance.js', function () {
var actual = mask.length; //picks 4 if the random number generator picks 0
- assert.equal(actual, expected, 'The expected default mask length is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected default mask length is ' + expected + ' but it was ' + actual);
});
@@ -101,11 +101,11 @@ describe('finance.js', function () {
var expected = 4;
- var mask = faker.finance.mask(0, false, false);
+ faker.finance.mask(0, false, false);
var actual = 4; //picks 4 if the random number generator picks 0
- assert.equal(actual, expected, 'The expected default mask length is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected default mask length is ' + expected + ' but it was ' + actual);
});
@@ -119,7 +119,7 @@ describe('finance.js', function () {
var regexp = new RegExp(/(\(\d{4}?\))/);
var actual = regexp.test(mask);
- assert.equal(actual, expected, 'The expected match for parentheses is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected match for parentheses is ' + expected + ' but it was ' + actual);
});
@@ -132,7 +132,7 @@ describe('finance.js', function () {
var regexp = new RegExp(/(\.\.\.\d{4})/);
var actual = regexp.test(mask);
- assert.equal(actual, expected, 'The expected match for parentheses is ' + expected + ' but it was ' + actual);
+ assert.strictEqual(actual, expected, 'The expected match for parentheses is ' + expected + ' but it was ' + actual);
});
@@ -156,8 +156,8 @@ describe('finance.js', function () {
var amount = faker.finance.amount();
assert.ok(amount);
- assert.equal((amount > 0), true, "the amount should be greater than 0");
- assert.equal((amount < 1001), true, "the amount should be greater than 0");
+ assert.strictEqual((amount > 0), true, "the amount should be greater than 0");
+ assert.strictEqual((amount < 1001), true, "the amount should be greater than 0");
});
@@ -183,7 +183,7 @@ describe('finance.js', function () {
var expected = true;
var actual = regexp.test(amount);
- assert.equal(actual, expected, 'The expected match should not include a currency symbol');
+ assert.strictEqual(actual, expected, 'The expected match should not include a currency symbol');
});
@@ -192,8 +192,8 @@ describe('finance.js', function () {
var amount = faker.finance.amount(-200, -1);
assert.ok(amount);
- assert.equal((amount < 0), true, "the amount should be greater than 0");
- assert.equal((amount > -201), true, "the amount should be greater than 0");
+ assert.strictEqual((amount < 0), true, "the amount should be greater than 0");
+ assert.strictEqual((amount > -201), true, "the amount should be greater than 0");
});
@@ -349,7 +349,7 @@ describe('finance.js', function () {
var iban = faker.finance.iban();
var bban = iban.substring(4) + iban.substring(0, 4);
- assert.equal(ibanLib.mod97(ibanLib.toDigitString(bban)), 1, "the result should be equal to 1");
+ assert.strictEqual(ibanLib.mod97(ibanLib.toDigitString(bban)), 1, "the result should be equal to 1");
});
});
diff --git a/test/helpers.unit.js b/test/helpers.unit.js
index f08be413..5bbe0fcc 100644
--- a/test/helpers.unit.js
+++ b/test/helpers.unit.js
@@ -47,39 +47,39 @@ describe("helpers.js", function () {
it("mutates the input array in place", function () {
var input = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
var shuffled = faker.helpers.shuffle(input);
- assert.deepEqual(shuffled, input);
+ assert.deepStrictEqual(shuffled, input);
});
it("all items shuffled as expected when seeded", function () {
var input = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
faker.seed(100);
var shuffled = faker.helpers.shuffle(input);
- assert.deepEqual(shuffled, ["b", "e", "a", "d", "j", "i", "h", "c", "g", "f"]);
+ assert.deepStrictEqual(shuffled, ["b", "e", "a", "d", "j", "i", "h", "c", "g", "f"]);
});
});
describe("slugify()", function () {
it("removes unwanted characters from URI string", function () {
- assert.equal(faker.helpers.slugify("Aiden.HarÂȘann"), "Aiden.Harann");
- assert.equal(faker.helpers.slugify("d'angelo.net"), "dangelo.net");
+ assert.strictEqual(faker.helpers.slugify("Aiden.HarÂȘann"), "Aiden.Harann");
+ assert.strictEqual(faker.helpers.slugify("d'angelo.net"), "dangelo.net");
});
});
describe("mustache()", function () {
it("returns empty string with no arguments", function () {
- assert.equal(faker.helpers.mustache(), "");
+ assert.strictEqual(faker.helpers.mustache(), "");
});
});
describe("repeatString()", function () {
it("returns empty string with no arguments", function () {
- assert.equal(faker.helpers.repeatString(), "");
+ assert.strictEqual(faker.helpers.repeatString(), "");
});
});
describe("replaceSymbols()", function () {
it("returns empty string with no arguments", function () {
- assert.equal(faker.helpers.replaceSymbols(), "");
+ assert.strictEqual(faker.helpers.replaceSymbols(), "");
});
});
diff --git a/test/image.unit.js b/test/image.unit.js
index ca4c6c29..7279e6a0 100644
--- a/test/image.unit.js
+++ b/test/image.unit.js
@@ -10,40 +10,40 @@ describe("image.js", function () {
it("returns a random image url from lorempixel", function () {
var imageUrl = faker.image.lorempicsum.imageUrl();
- assert.equal(imageUrl, 'https://picsum.photos/640/480');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/640/480');
});
it("returns a random image url from lorem picsum with width and height", function () {
var imageUrl = faker.image.lorempicsum.imageUrl(100, 100);
- assert.equal(imageUrl, 'https://picsum.photos/100/100');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/100/100');
});
it("returns a random image url grayscaled", function () {
var imageUrl = faker.image.lorempicsum.imageUrl(100, 100, true);
- assert.equal(imageUrl, 'https://picsum.photos/100/100?grayscale');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/100/100?grayscale');
});
it("returns a random image url grayscaled and blurred", function () {
var imageUrl = faker.image.lorempicsum.imageUrl(100, 100, true, 2);
- assert.equal(imageUrl, 'https://picsum.photos/100/100?grayscale&blur=2');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/100/100?grayscale&blur=2');
});
it("returns a random image url blurred", function () {
var imageUrl = faker.image.lorempicsum.imageUrl(100, 100, undefined, 2);
- assert.equal(imageUrl, 'https://picsum.photos/100/100?blur=2');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/100/100?blur=2');
});
it("returns a random image url with seed", function () {
var imageUrl = faker.image.lorempicsum.imageUrl(100, 100, undefined, undefined, 'picsum');
- assert.equal(imageUrl, 'https://picsum.photos/seed/picsum/100/100');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/seed/picsum/100/100');
});
});
describe("avatar()", function () {
it("return a random avatar from UIFaces", function () {
- assert.notEqual(-1, faker.image.lorempicsum.avatar().indexOf('s3.amazonaws.com/uifaces/faces'));
+ assert.strictEqual(-1, faker.image.lorempicsum.avatar().indexOf('s3.amazonaws.com/uifaces/faces'));
})
});
@@ -51,21 +51,21 @@ describe("image.js", function () {
it("returns a random URL with grayscale image", function () {
var imageUrl = faker.image.lorempicsum.imageGrayscale(100, 100, true);
- assert.equal(imageUrl, 'https://picsum.photos/100/100?grayscale');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/100/100?grayscale');
});
});
describe("imageBlurred()", function () {
it("returns a random image url blurred", function () {
var imageUrl = faker.image.lorempicsum.imageBlurred(100, 100, 2);
- assert.equal(imageUrl, 'https://picsum.photos/100/100?blur=2');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/100/100?blur=2');
});
});
describe("imageRandomSeeded()", function () {
it("returns a random image url blurred", function () {
var imageUrl = faker.image.lorempicsum.imageRandomSeeded(100, 100, undefined, undefined, 'picsum');
- assert.equal(imageUrl, 'https://picsum.photos/seed/picsum/100/100');
+ assert.strictEqual(imageUrl, 'https://picsum.photos/seed/picsum/100/100');
});
});
});
@@ -75,100 +75,100 @@ describe("image.js", function () {
it("returns a random image url from lorempixel", function () {
var imageUrl = faker.image.lorempixel.imageUrl();
- assert.equal(imageUrl, 'https://lorempixel.com/640/480');
+ assert.strictEqual(imageUrl, 'https://lorempixel.com/640/480');
});
it("returns a random image url from lorempixel with width and height", function () {
var imageUrl = faker.image.lorempixel.imageUrl(100, 100);
- assert.equal(imageUrl, 'https://lorempixel.com/100/100');
+ assert.strictEqual(imageUrl, 'https://lorempixel.com/100/100');
});
it("returns a random image url for a specified category", function () {
var imageUrl = faker.image.lorempixel.imageUrl(100, 100, 'abstract');
- assert.equal(imageUrl, 'https://lorempixel.com/100/100/abstract');
+ assert.strictEqual(imageUrl, 'https://lorempixel.com/100/100/abstract');
});
});
describe("avatar()", function () {
it("return a random avatar from UIFaces", function () {
- assert.notEqual(-1, faker.image.lorempixel.avatar().indexOf('s3.amazonaws.com/uifaces/faces'));
+ assert.notStrictEqual(-1, faker.image.lorempixel.avatar().indexOf('s3.amazonaws.com/uifaces/faces'));
})
});
describe("abstract()", function () {
it("returns a random abstract image url", function () {
var abstract = faker.image.lorempixel.abstract();
- assert.equal(abstract, 'https://lorempixel.com/640/480/abstract');
+ assert.strictEqual(abstract, 'https://lorempixel.com/640/480/abstract');
});
});
describe("animals()", function () {
it("returns a random animals image url", function () {
var animals = faker.image.lorempixel.animals();
- assert.equal(animals, 'https://lorempixel.com/640/480/animals');
+ assert.strictEqual(animals, 'https://lorempixel.com/640/480/animals');
});
});
describe("business()", function () {
it("returns a random business image url", function () {
var business = faker.image.lorempixel.business();
- assert.equal(business, 'https://lorempixel.com/640/480/business');
+ assert.strictEqual(business, 'https://lorempixel.com/640/480/business');
});
});
describe("cats()", function () {
it("returns a random cats image url", function () {
var cats = faker.image.lorempixel.cats();
- assert.equal(cats, 'https://lorempixel.com/640/480/cats');
+ assert.strictEqual(cats, 'https://lorempixel.com/640/480/cats');
});
});
describe("city()", function () {
it("returns a random city image url", function () {
var city = faker.image.lorempixel.city();
- assert.equal(city, 'https://lorempixel.com/640/480/city');
+ assert.strictEqual(city, 'https://lorempixel.com/640/480/city');
});
});
describe("food()", function () {
it("returns a random food image url", function () {
var food = faker.image.lorempixel.food();
- assert.equal(food, 'https://lorempixel.com/640/480/food');
+ assert.strictEqual(food, 'https://lorempixel.com/640/480/food');
});
});
describe("nightlife()", function () {
it("returns a random nightlife image url", function () {
var nightlife = faker.image.lorempixel.nightlife();
- assert.equal(nightlife, 'https://lorempixel.com/640/480/nightlife');
+ assert.strictEqual(nightlife, 'https://lorempixel.com/640/480/nightlife');
});
});
describe("fashion()", function () {
it("returns a random fashion image url", function () {
var fashion = faker.image.lorempixel.fashion();
- assert.equal(fashion, 'https://lorempixel.com/640/480/fashion');
+ assert.strictEqual(fashion, 'https://lorempixel.com/640/480/fashion');
});
});
describe("people()", function () {
it("returns a random people image url", function () {
var people = faker.image.lorempixel.people();
- assert.equal(people, 'https://lorempixel.com/640/480/people');
+ assert.strictEqual(people, 'https://lorempixel.com/640/480/people');
});
});
describe("nature()", function () {
it("returns a random nature image url", function () {
var nature = faker.image.lorempixel.nature();
- assert.equal(nature, 'https://lorempixel.com/640/480/nature');
+ assert.strictEqual(nature, 'https://lorempixel.com/640/480/nature');
});
});
describe("sports()", function () {
it("returns a random sports image url", function () {
var sports = faker.image.lorempixel.sports();
- assert.equal(sports, 'https://lorempixel.com/640/480/sports');
+ assert.strictEqual(sports, 'https://lorempixel.com/640/480/sports');
});
});
describe("technics()", function () {
it("returns a random technics image url", function () {
var technics = faker.image.lorempixel.technics();
- assert.equal(technics, 'https://lorempixel.com/640/480/technics');
+ assert.strictEqual(technics, 'https://lorempixel.com/640/480/technics');
});
});
describe("transport()", function () {
it("returns a random transport image url", function () {
var transport = faker.image.lorempixel.transport();
- assert.equal(transport, 'https://lorempixel.com/640/480/transport');
+ assert.strictEqual(transport, 'https://lorempixel.com/640/480/transport');
});
});
});
@@ -178,80 +178,80 @@ describe("image.js", function () {
it("returns a random image url from unsplash", function () {
var imageUrl = faker.image.unsplash.imageUrl();
- assert.equal(imageUrl, 'https://source.unsplash.com/640x480');
+ assert.strictEqual(imageUrl, 'https://source.unsplash.com/640x480');
});
it("returns a random image url from unsplash with width and height", function () {
var imageUrl = faker.image.unsplash.imageUrl(100, 100);
- assert.equal(imageUrl, 'https://source.unsplash.com/100x100');
+ assert.strictEqual(imageUrl, 'https://source.unsplash.com/100x100');
});
it("returns a random image url for a specified category", function () {
var imageUrl = faker.image.unsplash.imageUrl(100, 100, 'food');
- assert.equal(imageUrl, 'https://source.unsplash.com/category/food/100x100');
+ assert.strictEqual(imageUrl, 'https://source.unsplash.com/category/food/100x100');
});
it("returns a random image url with correct keywords for a specified category", function () {
var imageUrl = faker.image.unsplash.imageUrl(100, 100, 'food', 'keyword1,keyword2');
- assert.equal(imageUrl, 'https://source.unsplash.com/category/food/100x100?keyword1,keyword2');
+ assert.strictEqual(imageUrl, 'https://source.unsplash.com/category/food/100x100?keyword1,keyword2');
});
it("returns a random image url without keyword which format is wrong for a specified category", function () {
var imageUrl = faker.image.unsplash.imageUrl(100, 100, 'food', 'keyword1,?ds)0123$*908932409');
- assert.equal(imageUrl, 'https://source.unsplash.com/category/food/100x100');
+ assert.strictEqual(imageUrl, 'https://source.unsplash.com/category/food/100x100');
});
});
describe("image()", function() {
it("returns a searching image url with keyword", function () {
var food = faker.image.unsplash.image(100, 200, 'keyword1,keyword2,keyword3');
- assert.equal(food, 'https://source.unsplash.com/100x200?keyword1,keyword2,keyword3');
+ assert.strictEqual(food, 'https://source.unsplash.com/100x200?keyword1,keyword2,keyword3');
});
})
describe("food()", function () {
it("returns a random food image url", function () {
var food = faker.image.unsplash.food();
- assert.equal(food, 'https://source.unsplash.com/category/food/640x480');
+ assert.strictEqual(food, 'https://source.unsplash.com/category/food/640x480');
});
});
describe("people()", function () {
it("returns a random people image url", function () {
var people = faker.image.unsplash.people();
- assert.equal(people, 'https://source.unsplash.com/category/people/640x480');
+ assert.strictEqual(people, 'https://source.unsplash.com/category/people/640x480');
});
});
describe("nature()", function () {
it("returns a random nature image url", function () {
var nature = faker.image.unsplash.nature();
- assert.equal(nature, 'https://source.unsplash.com/category/nature/640x480');
+ assert.strictEqual(nature, 'https://source.unsplash.com/category/nature/640x480');
});
});
describe("technology()", function () {
it("returns a random technology image url", function () {
var transport = faker.image.unsplash.technology();
- assert.equal(transport, 'https://source.unsplash.com/category/technology/640x480');
+ assert.strictEqual(transport, 'https://source.unsplash.com/category/technology/640x480');
});
});
describe("objects()", function () {
it("returns a random objects image url", function () {
var transport = faker.image.unsplash.objects();
- assert.equal(transport, 'https://source.unsplash.com/category/objects/640x480');
+ assert.strictEqual(transport, 'https://source.unsplash.com/category/objects/640x480');
});
});
describe("buildings()", function () {
it("returns a random buildings image url", function () {
var transport = faker.image.unsplash.buildings();
- assert.equal(transport, 'https://source.unsplash.com/category/buildings/640x480');
+ assert.strictEqual(transport, 'https://source.unsplash.com/category/buildings/640x480');
});
});
});
describe("dataUri", function () {
it("returns a blank data", function () {
var dataUri = faker.image.dataUri(200,300);
- assert.equal(dataUri, 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22200%22%20height%3D%22300%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22grey%22%2F%3E%3Ctext%20x%3D%22100%22%20y%3D%22150%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E200x300%3C%2Ftext%3E%3C%2Fsvg%3E');
+ assert.strictEqual(dataUri, 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22200%22%20height%3D%22300%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22grey%22%2F%3E%3Ctext%20x%3D%22100%22%20y%3D%22150%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E200x300%3C%2Ftext%3E%3C%2Fsvg%3E');
});
it("returns a customed background color data URI", function () {
var dataUri = faker.image.dataUri(200, 300, 'red');
- assert.equal(dataUri, 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22200%22%20height%3D%22300%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%22100%22%20y%3D%22150%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E200x300%3C%2Ftext%3E%3C%2Fsvg%3E');
+ assert.strictEqual(dataUri, 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%22200%22%20height%3D%22300%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22red%22%2F%3E%3Ctext%20x%3D%22100%22%20y%3D%22150%22%20font-size%3D%2220%22%20alignment-baseline%3D%22middle%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3E200x300%3C%2Ftext%3E%3C%2Fsvg%3E');
});
});
});
diff --git a/test/internet.unit.js b/test/internet.unit.js
index a554cea0..79fce56f 100644
--- a/test/internet.unit.js
+++ b/test/internet.unit.js
@@ -11,7 +11,7 @@ describe("internet.js", function () {
var email = faker.internet.email("Aiden.Harann55");
var res = email.split("@");
res = res[0];
- assert.equal(res, 'Aiden.Harann55');
+ assert.strictEqual(res, 'Aiden.Harann55');
faker.internet.userName.restore();
});
});
@@ -22,7 +22,7 @@ describe("internet.js", function () {
var email = faker.internet.email("Aiden.Harann55");
var res = email.split("@");
res = res[0];
- assert.equal(res, 'Aiden.Harann55');
+ assert.strictEqual(res, 'Aiden.Harann55');
faker.internet.userName.restore();
});
@@ -71,7 +71,7 @@ describe("internet.js", function () {
var domain_name = faker.internet.domainName();
- assert.equal(domain_name, 'bar.net');
+ assert.strictEqual(domain_name, 'bar.net');
faker.internet.domainWord.restore();
faker.internet.domainSuffix.restore();
@@ -142,7 +142,7 @@ describe("internet.js", function () {
it("returns a random IP address with four parts", function () {
var ip = faker.internet.ip();
var parts = ip.split('.');
- assert.equal(parts.length, 4);
+ assert.strictEqual(parts.length, 4);
});
});
@@ -150,7 +150,7 @@ describe("internet.js", function () {
it("returns a random IPv6 address with eight parts", function () {
var ip = faker.internet.ipv6();
var parts = ip.split(':');
- assert.equal(parts.length, 8);
+ assert.strictEqual(parts.length, 8);
});
});
@@ -165,7 +165,7 @@ describe("internet.js", function () {
var ua1 = faker.internet.userAgent();
faker.seed(1);
var ua2 = faker.internet.userAgent();
- assert.equal(ua1, ua2);
+ assert.strictEqual(ua1, ua2);
});
});
diff --git a/test/locales.unit.js b/test/locales.unit.js
index 932369f4..8f8be2d7 100644
--- a/test/locales.unit.js
+++ b/test/locales.unit.js
@@ -13,7 +13,7 @@ describe("locale", function () {
it("setLocale() changes faker.locale", function () {
for(var locale in faker.locales) {
faker.setLocale(locale)
- assert.equal(faker.locale, locale);
+ assert.strictEqual(faker.locale, locale);
}
});
});
diff --git a/test/lorem.unit.js b/test/lorem.unit.js
index 04c03a55..d7853a4b 100644
--- a/test/lorem.unit.js
+++ b/test/lorem.unit.js
@@ -18,7 +18,7 @@ describe("lorem.js", function () {
it("returns a word with the requested length", function () {
var str = faker.lorem.word(5);
assert.ok(typeof str === 'string');
- assert.equal(str.length, 5);
+ assert.strictEqual(str.length, 5);
});
});
});
@@ -37,7 +37,7 @@ describe("lorem.js", function () {
var str = faker.lorem.words();
var words = str.split(' ');
assert.ok(Array.isArray(words));
- assert.equal(true, words.length >= 3);
+ assert.strictEqual(true, words.length >= 3);
// assert.ok(faker.helpers.shuffle.called);
});
});
@@ -47,7 +47,7 @@ describe("lorem.js", function () {
var str = faker.lorem.words(7);
var words = str.split(' ');
assert.ok(Array.isArray(words));
- assert.equal(words.length, 7);
+ assert.strictEqual(words.length, 7);
});
});
});
@@ -62,8 +62,8 @@ describe("lorem.js", function () {
});
var validateSlug = function (wordCount, str) {
- assert.equal(1, str.match(/^[a-z][a-z-]*[a-z]$/).length);
- assert.equal(wordCount - 1, str.match(/-/g).length);
+ assert.strictEqual(1, str.match(/^[a-z][a-z-]*[a-z]$/).length);
+ assert.strictEqual(wordCount - 1, str.match(/-/g).length);
};
context("when no 'wordCount' param passed in", function () {
@@ -91,7 +91,7 @@ describe("lorem.js", function () {
var sentence = faker.lorem.sentence();
assert.ok(typeof sentence === 'string');
var parts = sentence.split(' ');
- assert.equal(parts.length, 5); // default 3 plus stubbed 2.
+ assert.strictEqual(parts.length, 5); // default 3 plus stubbed 2.
assert.ok(faker.lorem.words.calledWith(5));
faker.lorem.words.restore();
@@ -107,7 +107,7 @@ describe("lorem.js", function () {
assert.ok(typeof sentence === 'string');
var parts = sentence.split(' ');
- assert.equal(parts.length, 12); // requested 10 plus stubbed 2.
+ assert.strictEqual(parts.length, 12); // requested 10 plus stubbed 2.
assert.ok(faker.lorem.words.calledWith(12));
faker.lorem.words.restore();
@@ -124,7 +124,7 @@ describe("lorem.js", function () {
assert.ok(typeof sentence === 'string');
var parts = sentence.split(' ');
- assert.equal(parts.length, 14); // requested 10 plus stubbed 4.
+ assert.strictEqual(parts.length, 14); // requested 10 plus stubbed 4.
assert.ok(faker.random.number.calledWith(4)); // random.number should be called with the 'range' we passed.
assert.ok(faker.lorem.words.calledWith(14));
@@ -145,7 +145,7 @@ describe("lorem.js", function () {
assert.ok(typeof sentences === 'string');
var parts = sentences.split('\n');
- assert.equal(parts.length, 3);
+ assert.strictEqual(parts.length, 3);
assert.ok(faker.lorem.sentence.calledThrice);
faker.lorem.sentence.restore();
@@ -159,7 +159,7 @@ describe("lorem.js", function () {
assert.ok(typeof sentences === 'string');
var parts = sentences.split('\n');
- assert.equal(parts.length, 5);
+ assert.strictEqual(parts.length, 5);
faker.lorem.sentence.restore();
});
@@ -176,7 +176,7 @@ describe("lorem.js", function () {
assert.ok(typeof paragraph === 'string');
var parts = paragraph.split('\n');
- assert.equal(parts.length, 5); // default 3 plus stubbed 2.
+ assert.strictEqual(parts.length, 5); // default 3 plus stubbed 2.
assert.ok(faker.lorem.sentences.calledWith(5));
faker.lorem.sentences.restore();
@@ -192,7 +192,7 @@ describe("lorem.js", function () {
assert.ok(typeof paragraph === 'string');
var parts = paragraph.split('\n');
- assert.equal(parts.length, 12); // requested 10 plus stubbed 2.
+ assert.strictEqual(parts.length, 12); // requested 10 plus stubbed 2.
assert.ok(faker.lorem.sentences.calledWith(12));
faker.lorem.sentences.restore();
@@ -212,7 +212,7 @@ describe("lorem.js", function () {
assert.ok(typeof paragraphs === 'string');
var parts = paragraphs.split('\n \r');
- assert.equal(parts.length, 3);
+ assert.strictEqual(parts.length, 3);
assert.ok(faker.lorem.paragraph.calledThrice);
faker.lorem.paragraph.restore();
@@ -226,7 +226,7 @@ describe("lorem.js", function () {
assert.ok(typeof paragraphs === 'string');
var parts = paragraphs.split('\n \r');
- assert.equal(parts.length, 5);
+ assert.strictEqual(parts.length, 5);
faker.lorem.paragraph.restore();
});
diff --git a/test/music.unit.js b/test/music.unit.js
index df679333..3abc0787 100644
--- a/test/music.unit.js
+++ b/test/music.unit.js
@@ -10,7 +10,7 @@ describe("music.js", function () {
sinon.stub(faker.music, 'genre').returns('Rock');
var genre = faker.music.genre();
- assert.equal(genre, 'Rock');
+ assert.strictEqual(genre, 'Rock');
faker.music.genre.restore();
});
});
diff --git a/test/name.unit.js b/test/name.unit.js
index 361fde4e..40291d2b 100644
--- a/test/name.unit.js
+++ b/test/name.unit.js
@@ -16,7 +16,7 @@ describe("name.js", function () {
sinon.stub(faker.name, 'firstName').returns('foo');
var first_name = faker.name.firstName();
- assert.equal(first_name, 'foo');
+ assert.strictEqual(first_name, 'foo');
faker.name.firstName.restore();
});
@@ -46,7 +46,7 @@ describe("name.js", function () {
var last_name = faker.name.lastName();
- assert.equal(last_name, 'foo');
+ assert.strictEqual(last_name, 'foo');
faker.name.lastName.restore();
});
@@ -59,7 +59,7 @@ describe("name.js", function () {
var middle_name = faker.name.middleName();
- assert.equal(middle_name, 'foo');
+ assert.strictEqual(middle_name, 'foo');
faker.name.middleName.restore();
});
@@ -85,13 +85,13 @@ describe("name.js", function () {
it("returns male prefix", function () {
var middle_name = faker.name.middleName(0);
- assert.equal(middle_name, 'Genaddiesvich')
+ assert.strictEqual(middle_name, 'Genaddiesvich')
});
it("returns female prefix", function () {
var middle_name = faker.name.middleName(1);
- assert.equal(middle_name, 'Genaddievna');
+ assert.strictEqual(middle_name, 'Genaddievna');
});
});
});
@@ -130,7 +130,7 @@ describe("name.js", function () {
var name = faker.name.findName();
- assert.equal(name, 'X Y Z');
+ assert.strictEqual(name, 'X Y Z');
faker.random.number.restore();
faker.name.prefix.restore();
@@ -149,7 +149,7 @@ describe("name.js", function () {
var name = faker.name.findName();
- assert.equal(name, 'J K L');
+ assert.strictEqual(name, 'J K L');
faker.random.number.restore();
faker.name.prefix.restore();
@@ -164,7 +164,7 @@ describe("name.js", function () {
var parts = name.split(' ');
assert.ok(parts.length >= 3);
- assert.equal(parts[parts.length-1], 'Jr.');
+ assert.strictEqual(parts[parts.length-1], 'Jr.');
faker.name.suffix.restore();
faker.random.number.restore();
@@ -183,7 +183,7 @@ describe("name.js", function () {
var title = faker.name.title();
- assert.equal(title, 'Lead Solutions Supervisor');
+ assert.strictEqual(title, 'Lead Solutions Supervisor');
faker.name.title.restore();
});
@@ -231,13 +231,13 @@ describe("name.js", function () {
it("returns male prefix", function () {
var prefix = faker.name.prefix(0);
- assert.equal(prefix, 'Mp')
+ assert.strictEqual(prefix, 'Mp')
});
it("returns female prefix", function () {
var prefix = faker.name.prefix(1);
- assert.equal(prefix, 'Fp');
+ assert.strictEqual(prefix, 'Fp');
});
it("returns either prefix", function () {
@@ -267,7 +267,7 @@ describe("name.js", function () {
it("returns a prefix", function () {
var prefix = faker.name.prefix();
- assert.equal(prefix, 'P');
+ assert.strictEqual(prefix, 'P');
});
});
});
diff --git a/test/random.unit.js b/test/random.unit.js
index cdeb07f1..c9873354 100644
--- a/test/random.unit.js
+++ b/test/random.unit.js
@@ -52,8 +52,8 @@ describe("random.js", function () {
assert.ok(_.includes(results, 0.5));
assert.ok(_.includes(results, 1.0));
- assert.equal(results[0], 0);
- assert.equal(_.last(results), 1.5);
+ assert.strictEqual(results[0], 0);
+ assert.strictEqual(_.last(results), 1.5);
});
@@ -61,7 +61,7 @@ describe("random.js", function () {
var options = { min: 0.5, max: 0.99, precision: 0.01 };
for(var i = 0; i < 100; i++) {
var number = faker.random.number(options);
- assert.equal(number, Number(number.toFixed(2)));
+ assert.strictEqual(number, Number(number.toFixed(2)));
}
});
@@ -75,26 +75,26 @@ describe("random.js", function () {
faker.random.number(opts);
- assert.equal(opts.min, min);
- assert.equal(opts.max, max);
+ assert.strictEqual(opts.min, min);
+ assert.strictEqual(opts.max, max);
});
it('should return deterministic results when seeded with integer', function() {
faker.seed(100);
var name = faker.name.findName();
- assert.equal(name, 'Eva Jenkins');
+ assert.strictEqual(name, 'Eva Jenkins');
})
it('should return deterministic results when seeded with array - one element', function() {
faker.seed([10]);
var name = faker.name.findName();
- assert.equal(name, 'Duane Kub');
+ assert.strictEqual(name, 'Duane Kub');
})
it('should return deterministic results when seeded with array - multiple elements', function() {
faker.seed([10, 100, 1000]);
var name = faker.name.findName();
- assert.equal(name, 'Alma Shanahan');
+ assert.strictEqual(name, 'Alma Shanahan');
})
});
@@ -103,12 +103,12 @@ describe("random.js", function () {
it("returns a random float with a default precision value (0.01)", function() {
var number = faker.random.float();
- assert.equal(number, Number(number.toFixed(2)));
+ assert.strictEqual(number, Number(number.toFixed(2)));
});
it("returns a random float given a precision value", function() {
var number = faker.random.float(0.001);
- assert.equal(number, Number(number.toFixed(3)));
+ assert.strictEqual(number, Number(number.toFixed(3)));
});
it("returns a random number given a maximum value as Object", function() {
@@ -148,8 +148,8 @@ describe("random.js", function () {
assert.ok(_.includes(results, 0.5));
assert.ok(_.includes(results, 1.0));
- assert.equal(results[0], 0);
- assert.equal(_.last(results), 1.5);
+ assert.strictEqual(results[0], 0);
+ assert.strictEqual(_.last(results), 1.5);
});
@@ -157,7 +157,7 @@ describe("random.js", function () {
var options = { min: 0.5, max: 0.99, precision: 0.01 };
for(var i = 0; i < 100; i++) {
var number = faker.random.float(options);
- assert.equal(number, Number(number.toFixed(2)));
+ assert.strictEqual(number, Number(number.toFixed(2)));
}
});
@@ -171,8 +171,8 @@ describe("random.js", function () {
faker.random.float(opts);
- assert.equal(opts.min, min);
- assert.equal(opts.max, max);
+ assert.strictEqual(opts.min, min);
+ assert.strictEqual(opts.max, max);
});
});
diff --git a/test/system.unit.js b/test/system.unit.js
index dfcfcb0b..0198af62 100644
--- a/test/system.unit.js
+++ b/test/system.unit.js
@@ -9,7 +9,7 @@ describe("system.js", function () {
it("returns unix fs directory full path", function () {
sinon.stub(faker.random, 'words').returns('24/7');
var directoryPath = faker.system.directoryPath();
- assert.equal(directoryPath.indexOf('/'), 0, 'generated directoryPath should start with /');
+ assert.strictEqual(directoryPath.indexOf('/'), 0, 'generated directoryPath should start with /');
faker.random.words.restore();
});
@@ -19,7 +19,7 @@ describe("system.js", function () {
it("returns unix fs file full path", function () {
sinon.stub(faker.random, 'words').returns('24/7');
var filePath = faker.system.filePath();
- assert.equal(filePath.indexOf('/'), 0, 'generated filePath should start with /');
+ assert.strictEqual(filePath.indexOf('/'), 0, 'generated filePath should start with /');
faker.random.words.restore();
});
@@ -29,7 +29,7 @@ describe("system.js", function () {
it("returns filenames without system path seperators", function () {
sinon.stub(faker.random, 'words').returns('24/7');
var fileName = faker.system.fileName();
- assert.equal(fileName.indexOf('/'), -1, 'generated fileNames should not have path seperators');
+ assert.strictEqual(fileName.indexOf('/'), -1, 'generated fileNames should not have path seperators');
faker.random.words.restore();
});
@@ -39,7 +39,7 @@ describe("system.js", function () {
it("returns filenames without system path seperators", function () {
sinon.stub(faker.random, 'words').returns('24/7');
var fileName = faker.system.commonFileName();
- assert.equal(fileName.indexOf('/'), -1, 'generated commonFileNames should not have path seperators');
+ assert.strictEqual(fileName.indexOf('/'), -1, 'generated commonFileNames should not have path seperators');
faker.random.words.restore();
});
diff --git a/test/unique.unit.js b/test/unique.unit.js
index 47b38d9d..3681e0b3 100644
--- a/test/unique.unit.js
+++ b/test/unique.unit.js
@@ -9,7 +9,7 @@ describe("unique.js", function () {
it("is able to call a function with no arguments and return a result", function () {
var result = faker.unique(faker.internet.email);
- assert.equal(typeof result, 'string');
+ assert.strictEqual(typeof result, 'string');
});
it("is able to call a function with arguments and return a result", function () {
@@ -24,7 +24,7 @@ describe("unique.js", function () {
it("is able to exclude results as array", function () {
var result = faker.unique(faker.internet.protocol, [], { exclude: ['https'] });
- assert.equal(result, 'http');
+ assert.strictEqual(result, 'http');
});
it("is able to limit unique call by maxTime in ms", function () {
@@ -32,7 +32,7 @@ describe("unique.js", function () {
try {
result = faker.unique(faker.internet.protocol, [], { maxTime: 1, maxRetries: 9999, exclude: ['https', 'http'] });
} catch (err) {
- assert.equal(err.message.substr(0, 16), 'Exceeded maxTime');
+ assert.strictEqual(err.message.substr(0, 16), 'Exceeded maxTime');
}
});
@@ -41,7 +41,7 @@ describe("unique.js", function () {
try {
result = faker.unique(faker.internet.protocol, [], { maxTime: 5000, maxRetries: 5, exclude: ['https', 'http'] });
} catch (err) {
- assert.equal(err.message.substr(0, 19), 'Exceeded maxRetries');
+ assert.strictEqual(err.message.substr(0, 19), 'Exceeded maxRetries');
}
});
diff --git a/test/vehicle.unit.js b/test/vehicle.unit.js
index 1d9802e8..82864da3 100644
--- a/test/vehicle.unit.js
+++ b/test/vehicle.unit.js
@@ -10,7 +10,7 @@ describe("vehicle.js", function () {
sinon.stub(faker.vehicle, 'vehicle').returns('Ford Explorer');
var vehicle = faker.vehicle.vehicle();
- assert.equal(vehicle, 'Ford Explorer');
+ assert.strictEqual(vehicle, 'Ford Explorer');
faker.vehicle.vehicle.restore();
});
});
@@ -20,7 +20,7 @@ describe("vehicle.js", function () {
sinon.stub(faker.vehicle, 'manufacturer').returns('Porsche');
var manufacturer = faker.vehicle.manufacturer();
- assert.equal(manufacturer, 'Porsche');
+ assert.strictEqual(manufacturer, 'Porsche');
faker.vehicle.manufacturer.restore();
});
});
@@ -30,7 +30,7 @@ describe("vehicle.js", function () {
sinon.stub(faker.vehicle, 'type').returns('Minivan');
var type = faker.vehicle.type();
- assert.equal(type, 'Minivan');
+ assert.strictEqual(type, 'Minivan');
faker.vehicle.type.restore();
});
});
@@ -40,7 +40,7 @@ describe("vehicle.js", function () {
sinon.stub(faker.vehicle, 'fuel').returns('Hybrid');
var fuel = faker.vehicle.fuel();
- assert.equal(fuel, 'Hybrid');
+ assert.strictEqual(fuel, 'Hybrid');
faker.vehicle.fuel.restore();
});
});
@@ -57,7 +57,7 @@ describe("vehicle.js", function () {
sinon.stub(faker.vehicle, 'color').returns('black');
var color = faker.vehicle.color();
- assert.equal(color, 'black');
+ assert.strictEqual(color, 'black');
faker.vehicle.color.restore();
});
});