From 89edd15c5d0ccb90426e107dd078d9d64ca84399 Mon Sep 17 00:00:00 2001 From: siwalikm Date: Sat, 17 Nov 2018 14:02:22 +0530 Subject: adding test cases --- lib/time.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/time.js b/lib/time.js index 51f7a28f..580d33ee 100644 --- a/lib/time.js +++ b/lib/time.js @@ -11,7 +11,11 @@ var _Time = function(faker) { * @method faker.time.recent * @param {string} outputType - 'abbr' || 'wide' || 'unix' (default choice) */ - self.recent = function(outputType = "unix") { + self.recent = function(outputType) { + if (typeof outputType === "undefined") { + outputType = 'unix'; + } + var date = new Date(); switch (outputType) { case "abbr": @@ -21,7 +25,6 @@ var _Time = function(faker) { date = date.toTimeString(); break; case "unix": - default: date = date.getTime(); break; } -- cgit v1.2.3