From c39004b5b2900dd4623f4174e187f2ce5d7bea87 Mon Sep 17 00:00:00 2001 From: Viktoriia Date: Sun, 11 Jan 2026 22:21:42 +0200 Subject: [PATCH 1/3] Solution --- src/splitInteger.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index a610317d..a9f65fc3 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -4,18 +4,18 @@ const splitInteger = require('./splitInteger'); test(`should split a number into equal parts if a value is divisible by a numberOfParts`, () => { - + expect(splitInteger(6, 2)).toEqual([3, 3]); }); test(`should return a part equals to a value when splitting into 1 part`, () => { - + expect(splitInteger(6, 1)).toEqual([6]); }); test('should sort parts ascending if they are not equal', () => { - + expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]); }); test('should add zeros if value < numberOfParts', () => { - + expect(splitInteger(4, 5)).toEqual([0, 1, 1, 1, 1]); }); From da96d4c69d64cff7fd02c03b62ad00fe02d188a6 Mon Sep 17 00:00:00 2001 From: Viktoriia Date: Sun, 11 Jan 2026 22:27:46 +0200 Subject: [PATCH 2/3] Solution --- src/splitInteger.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index a9f65fc3..eb550059 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -9,11 +9,11 @@ test(`should split a number into equal parts test(`should return a part equals to a value when splitting into 1 part`, () => { - expect(splitInteger(6, 1)).toEqual([6]); + expect(splitInteger(8, 1)).toEqual([8]); }); test('should sort parts ascending if they are not equal', () => { - expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]); + expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); }); test('should add zeros if value < numberOfParts', () => { From fc8d1bc7c93585801e959010b0a4d9e691336527 Mon Sep 17 00:00:00 2001 From: Viktoriia Date: Sun, 11 Jan 2026 22:31:23 +0200 Subject: [PATCH 3/3] Solution --- src/splitInteger.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index eb550059..dcece3b7 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -16,6 +16,11 @@ test('should sort parts ascending if they are not equal', () => { expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); }); +test('should sort parts ascending if they are not equal', () => { + expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]); +}); + + test('should add zeros if value < numberOfParts', () => { expect(splitInteger(4, 5)).toEqual([0, 1, 1, 1, 1]); });