Sha256: 61795201e032bf9d45a2b4a455c5fdb8a9600c93fc0be17df5e5b9e1fcb1b63d

Contents?: true

Size: 1.43 KB

Versions: 57

Compression:

Stored size: 1.43 KB

Contents

import SpaceAge from './space-age'

describe('Space Age', () => {

  it('age in seconds', () => {
    const age = new SpaceAge(1000000)
    expect(age.seconds).toEqual(1000000)
  })

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

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

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

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

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

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

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

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

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
trackler-2.0.8.32 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.31 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.30 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.29 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.28 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.27 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.26 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.24 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.23 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.22 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.21 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.20 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.19 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.18 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.17 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.16 tracks/typescript/exercises/space-age/space-age.test.ts
trackler-2.0.8.15 tracks/typescript/exercises/space-age/space-age.test.ts