aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkaykhan <[email protected]>2019-06-20 14:18:52 +0100
committerkaykhan <[email protected]>2019-06-20 14:18:52 +0100
commitaec3829d0021cb34cd83f68603be7273543877ae (patch)
tree3b9f1a26acd423c33196ed77bfe472ae3da58918 /test
parent10bfb9f467b0ac2b8912ffc15690b50ef3244f09 (diff)
downloadfaker-aec3829d0021cb34cd83f68603be7273543877ae.tar.xz
faker-aec3829d0021cb34cd83f68603be7273543877ae.zip
feat: added support for generating a random alpha-3 country code
Diffstat (limited to 'test')
-rw-r--r--test/address.unit.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/address.unit.js b/test/address.unit.js
index d63cb78c..b08ef0bb 100644
--- a/test/address.unit.js
+++ b/test/address.unit.js
@@ -208,6 +208,7 @@ describe("address.js", function () {
});
describe("countryCode()", function () {
+
it("returns random countryCode", function () {
sinon.spy(faker.address, 'countryCode');
var countryCode = faker.address.countryCode();
@@ -215,6 +216,16 @@ describe("address.js", function () {
assert.ok(faker.address.countryCode.called);
faker.address.countryCode.restore();
});
+
+ it("returns random alpha-3 countryCode", function () {
+ sinon.spy(faker.address, 'countryCode');
+ var countryCode = faker.address.countryCode("alpha-3");
+ assert.ok(countryCode);
+ assert.ok(faker.address.countryCode.called);
+ assert.equal(countryCode.length, 3);
+ faker.address.countryCode.restore();
+ });
+
});
describe("state()", function () {