-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
|
||
state: [ | ||
"Alberta", | ||
"British Columbia", | ||
"Manitoba", | ||
"New Brunswick", | ||
"Newfoundland and Labrador", | ||
"Nova Scotia", | ||
"Northwest Territories", | ||
"Nunavut", | ||
"Ontario", | ||
"Prince Edward Island", | ||
"Quebec", | ||
"Saskatchewan", | ||
"Yukon" | ||
], | ||
stateAbbr: [ | ||
"AB", | ||
"BC", | ||
"MB", | ||
"NB", | ||
"NL", | ||
"NS", | ||
"NU", | ||
"NT", | ||
"ON", | ||
"PE", | ||
"QC", | ||
"SK", | ||
"YT" | ||
], | ||
|
||
postCode: [ | ||
"?#? #?#" | ||
] | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = [ | ||
"Avenue", | ||
"Boulevard", | ||
"Circle", | ||
"Circuit", | ||
"Court", | ||
"Crescent", | ||
"Crest", | ||
"Drive", | ||
"Estate Dr", | ||
"Grove", | ||
"Hill", | ||
"Island", | ||
"Junction", | ||
"Knoll", | ||
"Lane", | ||
"Loop", | ||
"Mall", | ||
"Manor", | ||
"Meadow", | ||
"Mews", | ||
"Parade", | ||
"Parkway", | ||
"Pass", | ||
"Place", | ||
"Plaza", | ||
"Ridge", | ||
"Road", | ||
"Run", | ||
"Square", | ||
"Station St", | ||
"Street", | ||
"Summit", | ||
"Terrace", | ||
"Track", | ||
"Trail", | ||
"View Rd", | ||
"Way" | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import isNil from "lodash/isNil"; | ||
import isArray from "lodash/isArray"; | ||
import isFunction from "lodash/isFunction"; | ||
import isObject from "lodash/isObject"; | ||
import mergeWith from "lodash/mergeWith"; | ||
|
||
import Fakerator from "lib/fakerator"; | ||
|
||
module.exports = function() { | ||
let locale = require("lib/locales/en-CA"); | ||
let fbLocale = require("lib/locales/default"); | ||
|
||
// Merge locale and fallback | ||
locale = mergeWith(locale, fbLocale, (objValue) => { | ||
// DON'T MERGE ARRAYS | ||
if (isArray(objValue) || isFunction(objValue)) | ||
return objValue; | ||
|
||
if (!isNil(objValue) && !isObject(objValue)) | ||
return objValue; | ||
}); | ||
|
||
return new Fakerator(locale); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
_meta: { | ||
id: "en-AU", | ||
fallback: null, | ||
language: "English (Canada)", | ||
country: "Canada", | ||
countryCode: "CA" | ||
}, | ||
|
||
address: require("./address"), | ||
internet: require("./internet") | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
tld: [ | ||
"ca", | ||
"com", | ||
"biz", | ||
"info", | ||
"name", | ||
"net", | ||
"org" | ||
] | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
number: [ | ||
"0# #### ####", | ||
"+61 # #### ####", | ||
"04## ### ###", | ||
"+61 4## ### ###" | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { expect } from "chai"; | ||
|
||
import Fakerator from "lib"; | ||
|
||
describe("Locale en-CA", () => { | ||
|
||
let fakerator; | ||
|
||
beforeEach( () => { | ||
fakerator = new Fakerator("en-CA"); | ||
fakerator.seed(1111); | ||
}); | ||
|
||
it("check locale definitions", () => { | ||
expect(fakerator.locale.names).to.be.an("Object"); | ||
expect(fakerator.locale.phone).to.be.an("Object"); | ||
expect(fakerator.locale.address).to.be.an("Object"); | ||
expect(fakerator.locale.company).to.be.an("Object"); | ||
expect(fakerator.locale.internet).to.be.an("Object"); | ||
}); | ||
|
||
it("check address definitions", () => { | ||
expect(fakerator.address.postCode()).to.be.equal("i4g 9i2"); | ||
expect(fakerator.address.state()).to.be.equal("Prince Edward Island"); | ||
}); | ||
|
||
it("check internet definitions", () => { | ||
expect(fakerator.internet.domain()).to.be.equal("rolando.net"); | ||
}); | ||
|
||
}); |