aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsiwalikm <[email protected]>2018-11-17 14:02:22 +0530
committersiwalikm <[email protected]>2018-11-17 14:02:22 +0530
commit89edd15c5d0ccb90426e107dd078d9d64ca84399 (patch)
treecb215837166379b1160d28f1981c51bd651f3cb9 /test
parentc63ac00c2cca2062ce733851f7239ed8db3ad00a (diff)
downloadfaker-89edd15c5d0ccb90426e107dd078d9d64ca84399.tar.xz
faker-89edd15c5d0ccb90426e107dd078d9d64ca84399.zip
adding test cases
Diffstat (limited to 'test')
-rw-r--r--test/time.unit.js10
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());
+ });
});
});