diff options
| author | FotoVerite <[email protected]> | 2014-07-22 16:21:36 -0400 |
|---|---|---|
| committer | FotoVerite <[email protected]> | 2014-07-22 16:21:36 -0400 |
| commit | 6bed149da3df03edbe9a87145c8471d965d1bc3b (patch) | |
| tree | 178c0b899b0ea654f184e3fdf148ac10e051f5ee /test/date.unit.js | |
| parent | e47f38e811d1f487c460d65ca59d7ef6dc034819 (diff) | |
| parent | 503e1983a0181191efcc9ba174d2586a778ab06a (diff) | |
| download | faker-6bed149da3df03edbe9a87145c8471d965d1bc3b.tar.xz faker-6bed149da3df03edbe9a87145c8471d965d1bc3b.zip | |
Bug fixes and latest version.
Diffstat (limited to 'test/date.unit.js')
| -rw-r--r-- | test/date.unit.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/date.unit.js b/test/date.unit.js index e01f0531..04367383 100644 --- a/test/date.unit.js +++ b/test/date.unit.js @@ -31,6 +31,14 @@ describe("date.js", function () { assert.ok(Date.parse(date) > new Date()); }); + it("returns a future date when N = 0", function () { + + var refDate = new Date(); + var date = Date.parse(faker.Date.future(0), refDate.toJSON()); + + assert.ok(date > refDate); // date should be after the date given, but before the current time + }); + it("returns a date N years after the date given", function () { var refDate = new Date(1880, 11, 9, 10, 0, 0, 0); // set the date beyond the usual calculation (to make sure this is working correctly) @@ -46,7 +54,7 @@ describe("date.js", function () { var date = faker.Date.recent(30); - assert.ok(Date.parse(date) < new Date()); + assert.ok(Date.parse(date) <= new Date()); }); }); |
