aboutsummaryrefslogtreecommitdiff
path: root/test/all.functional.js
diff options
context:
space:
mode:
authorMarak <[email protected]>2014-09-15 02:49:40 +0200
committerMarak <[email protected]>2014-09-15 02:49:40 +0200
commitfbf2615e6e7bb28c3fc845c0cd94aa31d269fe75 (patch)
treeee098227830e9db2132d2f190da05334001c900b /test/all.functional.js
parent38f9e3a5b25606e605276acf3f39b6e5c8202255 (diff)
downloadfaker-fbf2615e6e7bb28c3fc845c0cd94aa31d269fe75.tar.xz
faker-fbf2615e6e7bb28c3fc845c0cd94aa31d269fe75.zip
[api] [refactor] Removed definitions.js file. All data definitions are now loaded from localized data sets, en is default locale. #116
Diffstat (limited to 'test/all.functional.js')
-rw-r--r--test/all.functional.js41
1 files changed, 18 insertions, 23 deletions
diff --git a/test/all.functional.js b/test/all.functional.js
index 621b9fd9..02b801ac 100644
--- a/test/all.functional.js
+++ b/test/all.functional.js
@@ -9,7 +9,7 @@ if (typeof module !== 'undefined') {
var modules = {
address: [
'city', 'streetName', 'streetAddress', 'secondaryAddress',
- 'brState', 'ukCountry', 'ukCounty', 'usState', 'zipCode'
+ 'country', 'county', 'state', 'zipCode'
],
company: ['companyName', 'companySuffix', 'catchPhrase', 'bs'],
@@ -20,28 +20,23 @@ var modules = {
name: ['firstName', 'lastName', 'findName'],
- phoneNumber: ['phoneNumber']
+ phone: ['phoneNumber']
};
describe("functional tests", function () {
- Object.keys(modules).forEach(function (module) {
- describe(module, function () {
- modules[module].forEach(function (meth) {
- it(meth + "()", function () {
- var result = faker[module][meth]();
- assert.ok(result);
- });
- });
- });
- });
-
- describe("Address", function () {
- it("zipCodeFormat()", function () {
- var result = faker.address.zipCodeFormat(0);
- assert.ok(!result.match(/-/));
-
- result = faker.address.zipCodeFormat(1);
- assert.ok(result.match(/-/));
- });
- });
-});
+
+ for(var locale in faker.locales) {
+ faker.locale = locale;
+ Object.keys(modules).forEach(function (module) {
+ describe(module, function () {
+ modules[module].forEach(function (meth) {
+ it(meth + "()", function () {
+ var result = faker[module][meth]();
+ assert.ok(result);
+ });
+ });
+ });
+ });
+ }
+
+}); \ No newline at end of file