Sha256: b73b101f742bcb1e1ad9ffb85fbb5067f00edd985e0a9419038673ccb2617178

Contents?: true

Size: 1.28 KB

Versions: 141

Compression:

Stored size: 1.28 KB

Contents

var Year = require('./leap');

describe('Leap year', function () {
  it('is not very common', function () {
    var year = new Year(2015);
    expect(year.isLeap()).toBe(false);
  });

  xit('is introduced every 4 years to adjust about a day', function () {
    var year = new Year(2016);
    expect(year.isLeap()).toBe(true);
  });

  xit('is skipped every 100 years to remove an extra day', function () {
    var year = new Year(1900);
    expect(year.isLeap()).toBe(false);
  });

  xit('is reintroduced every 400 years to adjust another day', function () {
    var year = new Year(2000);
    expect(year.isLeap()).toBe(true);
  });

  // Feel free to enable the following tests to check some more examples
  xdescribe('Additional example of a leap year that', function () {
    it('is not a leap year', function () {
      var year = new Year(1978);
      expect(year.isLeap()).toBe(false);
    });

    it('is a common leap year', function () {
      var year = new Year(1992);
      expect(year.isLeap()).toBe(true);
    });

    it('is skipped every 100 years', function () {
      var year = new Year(2100);
      expect(year.isLeap()).toBe(false);
    });

    it('is reintroduced every 400 years', function () {
      var year = new Year(2400);
      expect(year.isLeap()).toBe(true);
    });
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.97 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.96 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.95 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.94 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.93 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.92 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.91 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.90 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.89 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.88 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.87 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.86 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.85 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.84 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.83 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.82 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.81 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.80 tracks/javascript/exercises/leap/leap.spec.js
trackler-2.2.1.79 tracks/javascript/exercises/leap/leap.spec.js