Sha256: eb2cd5d0415eeb738b8434eeecd03f2ee79ea2e7aed94660b64e589daba2e055

Contents?: true

Size: 1014 Bytes

Versions: 185

Compression:

Stored size: 1014 Bytes

Contents

import PrimeFactors from './prime-factors';
const primeFactors = new PrimeFactors();

describe('primeFactors', () => {
  test('returns an empty array for 1', () => expect(primeFactors.for(1)).toEqual([]));

  xtest('factors 2', () => expect(primeFactors.for(2)).toEqual([2]));

  xtest('factors 3', () => expect(primeFactors.for(3)).toEqual([3]));

  xtest('factors 4', () => expect(primeFactors.for(4)).toEqual([2, 2]));

  xtest('factors 6', () => expect(primeFactors.for(6)).toEqual([2, 3]));

  xtest('factors 8', () => expect(primeFactors.for(8)).toEqual([2, 2, 2]));

  xtest('factors 9', () => expect(primeFactors.for(9)).toEqual([3, 3]));

  xtest('factors 27', () => expect(primeFactors.for(27)).toEqual([3, 3, 3]));

  xtest('factors 625', () => expect(primeFactors.for(625)).toEqual([5, 5, 5, 5]));

  xtest('factors 901255', () => expect(primeFactors.for(901255)).toEqual([5, 17, 23, 461]));

  xtest('factors 93819012551', () => expect(primeFactors.for(93819012551)).toEqual([11, 9539, 894119]));
});

Version data entries

185 entries across 185 versions & 1 rubygems

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