Sha256: 8a0c4af07e9eb45f855a614bbb52dad8f78aa330fa7ec88ce259b2e6dea803fc

Contents?: true

Size: 1010 Bytes

Versions: 135

Compression:

Stored size: 1010 Bytes

Contents

import calculatePrimeFactors from './prime-factors'

describe('calculatePrimeFactors', () => {
  it('returns an empty array for 1', () => expect(calculatePrimeFactors(1)).toEqual([]))

  xit('factors 2', () => expect(calculatePrimeFactors(2)).toEqual([2]))

  xit('factors 3', () => expect(calculatePrimeFactors(3)).toEqual([3]))

  xit('factors 4', () => expect(calculatePrimeFactors(4)).toEqual([2, 2]))

  xit('factors 6', () => expect(calculatePrimeFactors(6)).toEqual([2, 3]))

  xit('factors 8', () => expect(calculatePrimeFactors(8)).toEqual([2, 2, 2]))

  xit('factors 9', () => expect(calculatePrimeFactors(9)).toEqual([3, 3]))

  xit('factors 27', () => expect(calculatePrimeFactors(27)).toEqual([3, 3, 3]))

  xit('factors 625', () => expect(calculatePrimeFactors(625)).toEqual([5, 5, 5, 5]))

  xit('factors 901255', () => expect(calculatePrimeFactors(901255)).toEqual([5, 17, 23, 461]))

  xit('factors 93819012551', () => expect(calculatePrimeFactors(93819012551)).toEqual([11, 9539, 894119]))
})

Version data entries

135 entries across 135 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.179 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.178 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.177 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.176 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.175 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.174 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.173 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.172 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.171 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.170 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.169 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.167 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.166 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.165 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.164 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.163 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.162 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.161 tracks/typescript/exercises/prime-factors/prime-factors.test.ts
trackler-2.2.1.160 tracks/typescript/exercises/prime-factors/prime-factors.test.ts