Socialify

Folder ..

Viewing time.unit.js
29 lines (25 loc) • 928.0 B

 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 blaver = require('../index');
}

blaver.seed(1234);

describe("time.js", function () {
  describe("recent()", function () {
    it("returns the recent timestamp in Unix time format", function () {
      var date = blaver.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 = blaver.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 = blaver.time.recent('abbr');
      assert.ok(typeof date === 'string');
      // assert.ok(date == new Date().toLocaleTimeString());
    });
  });

});