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

describe('Gigasecond', function() {

  it('test 1', function() {
    var gs = new Gigasecond(new Date(2011, 3, 25));
    var expectedDate = new Date(2043, 0, 1);
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('test 2', function() {
    var gs = new Gigasecond(new Date(1977, 5, 13));
    var expectedDate = new Date(2009, 1, 19);
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('test 3', function() {
    var gs = new Gigasecond(new Date(1959, 6, 19));
    var expectedDate = new Date(1991, 2, 27);
    expect(gs.date()).toEqual(expectedDate);
  });

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

describe('Gigasecond', function() {

  it('test 1', function() {
    var gs = new Gigasecond(new Date(2011, 3, 25));
    var expectedDate = new Date(2043, 0, 1);
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('test 2', function() {
    var gs = new Gigasecond(new Date(1977, 5, 13));
    var expectedDate = new Date(2009, 1, 19);
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('test 3', function() {
    var gs = new Gigasecond(new Date(1959, 6, 19));
    var expectedDate = new Date(1991, 2, 27);
    expect(gs.date()).toEqual(expectedDate);
  });

  xit('test 4', function() {
    var gs = new Gigasecond(new Date(1959, 6, 19));
    var expectedDate = new Date(1991, 2, 27);
    gs.date();
    expect(gs.date()).toEqual(expectedDate);
  });
});

Test immutability of the gigasecond
Test immutability of the gigasecond

I have seen submissions which mutate the original date and return that. This works for the current test suite. However, when the `date` method gets called multiple times. That solution adds another gigasecond on a date where one is already applied.

For example. One might implement the date function like this:

```
Gigasecond.prototype.date = function() {
  b = new Date(this.birthday.setSeconds(this.birthday.getSeconds() + 1000000000 ));
  return new Date(b.getFullYear(), b.getMonth(), b.getDate());
};
```

```
var d = new Gigasecond(new Date(1995, 8, 27))
d.date()
// Sat Jun 05 2027 00:00:00 GMT+0200 (CEST)
d.date()
// Tue Feb 11 2059 00:00:00 GMT+0100 (CET)
```