diff options
| author | siwalikm <[email protected]> | 2018-11-12 00:09:59 +0530 |
|---|---|---|
| committer | siwalikm <[email protected]> | 2018-11-12 00:09:59 +0530 |
| commit | c63ac00c2cca2062ce733851f7239ed8db3ad00a (patch) | |
| tree | e88cefb3087851b0124eec13a74bc936a3342641 | |
| parent | 3a9a30d92f4c4bb9a20a34027ede6ce7bd5e9604 (diff) | |
| download | faker-c63ac00c2cca2062ce733851f7239ed8db3ad00a.tar.xz faker-c63ac00c2cca2062ce733851f7239ed8db3ad00a.zip | |
adding unit test
| -rw-r--r-- | lib/index.js | 3 | ||||
| -rw-r--r-- | test/time.unit.js | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/index.js b/lib/index.js index fdd11c78..a4e8b26a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -83,6 +83,9 @@ function Faker (opts) { var _Date = require('./date'); self.date = new _Date(self); + var _Time = require('./time'); + self.time = new _Time(self); + var Commerce = require('./commerce'); self.commerce = new Commerce(self); diff --git a/test/time.unit.js b/test/time.unit.js new file mode 100644 index 00000000..88b81904 --- /dev/null +++ b/test/time.unit.js @@ -0,0 +1,16 @@ +if (typeof module !== 'undefined') { + var assert = require('assert'); + var sinon = require('sinon'); + var faker = require('../index'); +} + +describe("time.js", function () { + describe("recent()", function () { + it("returns the recent timestamp in Unix time format", function () { + var date = faker.time.recent(); + assert.ok(date == new Date().getTime()); + }); + + }); + +}); |
