forked from zuriby/Faker.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
time.unit.js
30 lines (25 loc) · 1012 Bytes
/
time.unit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
if (typeof module !== 'undefined') {
var assert = require('assert');
var sinon = require('sinon');
var faker = require('../index');
}
faker.seed(1234);
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(typeof date === 'string');
// assert.ok(date == new Date().toTimeString());
});
it("returns the recent timestamp in abbreviated string format", function () {
var date = faker.time.recent('abbr');
assert.ok(typeof date === 'string');
// assert.ok(date == new Date().toLocaleTimeString());
});
});
});