aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMQuy <[email protected]>2014-09-08 11:42:46 +0700
committerMarak <[email protected]>2014-09-09 01:22:26 +0200
commitfa8267f2ce1a41a2684f10c5e2109faff837a0f9 (patch)
tree295cec8c4170c3cf763e4e7d0c3361271a86baf1 /test
parent3caea6078c05dd7caaffa4d2fd362ebe084168f9 (diff)
downloadfaker-fa8267f2ce1a41a2684f10c5e2109faff837a0f9.tar.xz
faker-fa8267f2ce1a41a2684f10c5e2109faff837a0f9.zip
add faker for phone code
Conflicts: lib/definitions.js
Diffstat (limited to 'test')
-rw-r--r--test/phone_number.unit.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/phone_number.unit.js b/test/phone_number.unit.js
index 80de4ea3..a90d27d1 100644
--- a/test/phone_number.unit.js
+++ b/test/phone_number.unit.js
@@ -26,4 +26,11 @@ describe("phone_number.js", function () {
assert.ok(phone_number.match(/\(\d\d\d\)\d\d\d-\d\d\d\d/));
});
});
+
+ describe("phoneCode()", function () {
+ it("returns a phone code with a format +xx", function () {
+ var phone_code = faker.PhoneNumber.phoneCode();
+ assert.ok(phone_code.match(/^\+\d{1,3}$/));
+ });
+ });
});