diff options
| author | siwalikm <[email protected]> | 2018-11-17 14:02:22 +0530 |
|---|---|---|
| committer | siwalikm <[email protected]> | 2018-11-17 14:02:22 +0530 |
| commit | 89edd15c5d0ccb90426e107dd078d9d64ca84399 (patch) | |
| tree | cb215837166379b1160d28f1981c51bd651f3cb9 /test | |
| parent | c63ac00c2cca2062ce733851f7239ed8db3ad00a (diff) | |
| download | faker-89edd15c5d0ccb90426e107dd078d9d64ca84399.tar.xz faker-89edd15c5d0ccb90426e107dd078d9d64ca84399.zip | |
adding test cases
Diffstat (limited to 'test')
| -rw-r--r-- | test/time.unit.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/time.unit.js b/test/time.unit.js index 88b81904..4ea07d2d 100644 --- a/test/time.unit.js +++ b/test/time.unit.js @@ -8,9 +8,19 @@ describe("time.js", function () { describe("recent()", function () { it("returns the recent timestamp in Unix time format", function () { var date = faker.time.recent(); + assert.ok(typeof date === 'number'); assert.ok(date == new Date().getTime()); }); + it("returns the recent timestamp in full time string format", function () { + var date = faker.time.recent('wide'); + assert.ok(date == new Date().toTimeString()); + }); + + it("returns the recent timestamp in abbreviated string format", function () { + var date = faker.time.recent('abbr'); + assert.ok(date == new Date().toLocaleTimeString()); + }); }); }); |
