Sha256: 5ac53a364c13d7083ca7e293cad881558256d161dfe51d57ff694bb8818a6b56

Contents?: true

Size: 1.12 KB

Versions: 141

Compression:

Stored size: 1.12 KB

Contents

var Gigasecond = require('./gigasecond');

describe('Gigasecond', function () {
  it('tells a gigasecond anniversary since midnight', function () {
    var gs = new Gigasecond(new Date(Date.UTC(2015, 8, 14)));
    var expectedDate = new Date(Date.UTC(2047, 4, 23, 1, 46, 40));
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('tells the anniversary is next day when you are born at night', function () {
    var gs = new Gigasecond(new Date(Date.UTC(2015, 8, 14, 23, 59, 59)));
    var expectedDate = new Date(Date.UTC(2047, 4, 24, 1, 46, 39));
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('even works before 1970 (beginning of Unix epoch)', function () {
    var gs = new Gigasecond(new Date(Date.UTC(1959, 6, 19, 5, 13, 45)));
    var expectedDate = new Date(Date.UTC(1991, 2, 27, 7, 0, 25));
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('make sure calling "date" doesn\'t mutate value', function () {
    var gs = new Gigasecond(new Date(Date.UTC(1959, 6, 19, 5, 13, 45)));
    var expectedDate = new Date(Date.UTC(1991, 2, 27, 7, 0, 25));
    gs.date();
    expect(gs.date()).toEqual(expectedDate);
  });
});


Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.118 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.117 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.116 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.115 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.114 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.113 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.111 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.110 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.109 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.108 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.107 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.106 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.105 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.104 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.103 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.102 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.101 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.100 tracks/javascript/exercises/gigasecond/gigasecond.spec.js
trackler-2.2.1.99 tracks/javascript/exercises/gigasecond/gigasecond.spec.js