Sha256: 04f010f19bef4c1c6ac7e13a30bb7c183aea6d3e64a65503949758af2770f044

Contents?: true

Size: 1.49 KB

Versions: 185

Compression:

Stored size: 1.49 KB

Contents

import SpaceAge from './space-age';

describe('Space Age', () => {
  test('age in seconds', () => {
    const age = new SpaceAge(1000000);
    expect(age.seconds).toEqual(1000000);
  });

  xtest('age in earth years', () => {
    const age = new SpaceAge(1000000000);
    expect(age.onEarth()).toEqual(31.69);
  });

  xtest('age in mercury years', () => {
    const age = new SpaceAge(2134835688);
    expect(age.onEarth()).toEqual(67.65);
    expect(age.onMercury()).toEqual(280.88);
  });

  xtest('age in venus years', () => {
    const age = new SpaceAge(189839836);
    expect(age.onEarth()).toEqual(6.02);
    expect(age.onVenus()).toEqual(9.78);
  });

  xtest('age in mars years', () => {
    const age = new SpaceAge(2329871239);
    expect(age.onEarth()).toEqual(73.83);
    expect(age.onMars()).toEqual(39.25);
  });

  xtest('age in jupiter years', () => {
    const age = new SpaceAge(901876382);
    expect(age.onEarth()).toEqual(28.58);
    expect(age.onJupiter()).toEqual(2.41);
  });

  xtest('age in saturn years', () => {
    const age = new SpaceAge(3000000000);
    expect(age.onEarth()).toEqual(95.06);
    expect(age.onSaturn()).toEqual(3.23);
  });

  xtest('age in uranus years', () => {
    const age = new SpaceAge(3210123456);
    expect(age.onEarth()).toEqual(101.72);
    expect(age.onUranus()).toEqual(1.21);
  });

  xtest('age in neptune year', () => {
    const age = new SpaceAge(8210123456);
    expect(age.onEarth()).toEqual(260.16);
    expect(age.onNeptune()).toEqual(1.58);
  });
});

Version data entries

185 entries across 185 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.138 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.137 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.136 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.135 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.134 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.133 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.132 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.131 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.130 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.129 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.128 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.127 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.126 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.125 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.124 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.123 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.122 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.121 tracks/ecmascript/exercises/space-age/space-age.spec.js
trackler-2.2.1.120 tracks/ecmascript/exercises/space-age/space-age.spec.js