-
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
16 changed files
with
480 additions
and
44 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
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
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
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ module["exports"] = [ | |
"org", | ||
"biz", | ||
"info", | ||
"name", | ||
"eu", | ||
"co" | ||
]; |
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
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
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,79 @@ | ||
import { expect } from "chai"; | ||
|
||
import Fakerator from "lib/fakerator"; | ||
|
||
describe("Default address", () => { | ||
|
||
let fakerator; | ||
|
||
beforeEach( () => { | ||
fakerator = new Fakerator(); | ||
fakerator.seed(8080); | ||
}); | ||
|
||
it("check address.country", () => { | ||
expect(fakerator.populate("#{address.country}")).to.be.equal("Qatar"); | ||
expect(fakerator.address.country()).to.be.equal("Bulgaria"); | ||
}); | ||
|
||
it("check address.city", () => { | ||
expect(fakerator.populate("#{address.city}")).to.be.equal("Merlestad"); | ||
expect(fakerator.address.city()).to.be.equal("East Vernon"); | ||
}); | ||
|
||
it("check address.cityPrefix", () => { | ||
expect(fakerator.populate("#{address.cityPrefix}")).to.be.equal("Lake"); | ||
expect(fakerator.address.cityPrefix()).to.be.equal("North"); | ||
}); | ||
|
||
it("check address.citySuffix", () => { | ||
expect(fakerator.populate("#{address.citySuffix}")).to.be.equal("chester"); | ||
expect(fakerator.address.citySuffix()).to.be.equal("land"); | ||
}); | ||
|
||
it("check address.street", () => { | ||
expect(fakerator.populate("#{address.street}")).to.be.equal("96214 Annette Radial Apt. 543"); | ||
expect(fakerator.address.street()).to.be.equal("64055 Jonathon Prairie Apt. 378"); | ||
}); | ||
|
||
it("check address.streetName", () => { | ||
expect(fakerator.populate("#{address.streetName}")).to.be.equal("Weber Plain"); | ||
expect(fakerator.address.streetName()).to.be.equal("Gabriel Islands"); | ||
}); | ||
|
||
it("check address.streetSuffix", () => { | ||
expect(fakerator.populate("#{address.streetSuffix}")).to.be.equal("Route"); | ||
expect(fakerator.address.streetSuffix()).to.be.equal("Crest"); | ||
}); | ||
|
||
it("check address.buildingNumber", () => { | ||
expect(fakerator.populate("#{address.buildingNumber}")).to.be.equal("196"); | ||
expect(fakerator.address.buildingNumber()).to.be.equal("14353"); | ||
}); | ||
|
||
it("check address.postCode", () => { | ||
expect(fakerator.populate("#{address.postCode}")).to.be.equal("19621-4353"); | ||
expect(fakerator.address.postCode()).to.be.equal("54360-6405"); | ||
}); | ||
|
||
it("check address.geoLocation", () => { | ||
let res = fakerator.address.geoLocation(); | ||
expect(res).to.be.an("Object"); | ||
expect(res.latitude).to.be.closeTo(40.4233, 0.01); | ||
expect(res.longitude).to.be.closeTo(-131.9741, 0.01); | ||
}); | ||
|
||
it("check address.geoLocationNearBy", () => { | ||
let res = fakerator.address.geoLocationNearBy({ | ||
latitude: 40, | ||
longitude: 19 | ||
}, 100); | ||
expect(res).to.be.an("Object"); | ||
expect(res.latitude).to.be.closeTo(39.85372, 0.01); | ||
expect(res.longitude).to.be.closeTo(17.8442, 0.01); | ||
|
||
}); | ||
|
||
|
||
|
||
}) |
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 { expect } from "chai"; | ||
|
||
import Fakerator from "lib/fakerator"; | ||
|
||
describe("Default company", () => { | ||
|
||
let fakerator; | ||
|
||
beforeEach( () => { | ||
fakerator = new Fakerator(); | ||
fakerator.seed(8080); | ||
}); | ||
|
||
it("check company.name", () => { | ||
expect(fakerator.populate("#{company.name}")).to.be.equal("Weber, Gleichner and Kertzmann Inc."); | ||
expect(fakerator.company.name()).to.be.equal("Orn-Johnson Inc."); | ||
}); | ||
|
||
it("check company.suffix", () => { | ||
expect(fakerator.populate("#{company.suffix}")).to.be.equal("LLC"); | ||
expect(fakerator.company.suffix()).to.be.equal("Ltd."); | ||
}); | ||
|
||
}) |
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,43 @@ | ||
import { expect } from "chai"; | ||
|
||
import Fakerator from "lib/fakerator"; | ||
|
||
describe("Default date", () => { | ||
|
||
let fakerator; | ||
|
||
beforeEach( () => { | ||
fakerator = new Fakerator(); | ||
fakerator.seed(8080); | ||
}); | ||
|
||
it("check date.timezone", () => { | ||
expect(fakerator.populate("#{date.timezone}")).to.be.equal("Asia/Bangkok"); | ||
expect(fakerator.date.timezone()).to.be.equal("America/Lima"); | ||
}); | ||
|
||
it("check date.past", () => { | ||
//expect(fakerator.populate("#{date.past}")).to.be.an("Date"); | ||
expect(fakerator.date.past()).to.be.an("Date"); | ||
expect(fakerator.date.past(10)).to.be.an("Date"); | ||
}); | ||
|
||
it("check date.future", () => { | ||
//expect(fakerator.populate("#{date.future}")).to.be.an("Date"); | ||
expect(fakerator.date.future()).to.be.an("Date"); | ||
expect(fakerator.date.future(10)).to.be.an("Date"); | ||
}); | ||
|
||
it("check date.between", () => { | ||
//expect(fakerator.populate("#{date.between}")).to.be.an("Date"); | ||
expect(fakerator.date.between()).to.be.an("Date"); | ||
expect(fakerator.date.between(new Date(), new Date())).to.be.an("Date"); | ||
}); | ||
|
||
it("check date.recent", () => { | ||
//expect(fakerator.populate("#{date.recent}")).to.be.an("Date"); | ||
expect(fakerator.date.recent()).to.be.an("Date"); | ||
expect(fakerator.date.recent(10)).to.be.an("Date"); | ||
}); | ||
|
||
}) |
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,22 @@ | ||
import { expect } from "chai"; | ||
|
||
import Fakerator from "lib/fakerator"; | ||
|
||
describe("Locale default", () => { | ||
|
||
let fakerator; | ||
|
||
beforeEach( () => { | ||
fakerator = new Fakerator(); | ||
}); | ||
|
||
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"); | ||
expect(fakerator.locale.lorem).to.be.an("Object"); | ||
expect(fakerator.locale.date).to.be.an("Object"); | ||
}); | ||
}) |
Oops, something went wrong.