Sha256: 5a68b375412c3581a191125c740ff4f8faff331e43339ab4bab843af4b377aea

Contents?: true

Size: 1.01 KB

Versions: 160

Compression:

Stored size: 1.01 KB

Contents

import isLeapYear from './leap';

describe('A leap year', () => {

  it('is not very common', () => {
    expect(isLeapYear(2015)).toBeFalsy();
  });

  xit('is introduced every 4 years to adjust about a day', () => {
    expect(isLeapYear(2016)).toBeTruthy();
  });

  xit('is skipped every 100 years to remove an extra day', () => {
    expect(isLeapYear(1900)).toBeFalsy();
  });

  xit('is reintroduced every 400 years to adjust another day', () => {
    expect(isLeapYear(2000)).toBeTruthy();
  });

  // Feel free to enable the following tests to check some more examples
  xdescribe('Additional example of a leap year that', () => {

    it('is not a leap year', () => {
      expect(isLeapYear(1978)).toBeFalsy();
    });

    it('is a common leap year', () => {
      expect(isLeapYear(1992)).toBeTruthy();
    });

    it('is skipped every 100 years', () => {
      expect(isLeapYear(2100)).toBeFalsy();
    });

    it('is reintroduced every 400 years', () => {
      expect(isLeapYear(2400)).toBeTruthy();
    });

  });

});

Version data entries

160 entries across 160 versions & 1 rubygems

Version Path
trackler-2.1.0.4 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.1.0.3 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.1.0.2 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.1.0.1 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.1.0.0 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.55 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.54 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.53 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.52 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.51 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.50 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.49 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.48 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.47 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.46 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.45 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.44 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.43 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.42 tracks/ecmascript/exercises/leap/leap.spec.js
trackler-2.0.8.41 tracks/ecmascript/exercises/leap/leap.spec.js