From 91ec87902ba7b27706a12f455528998b6b6e1be6 Mon Sep 17 00:00:00 2001 From: Korshun Date: Thu, 8 Oct 2026 12:51:23 +0300 Subject: [PATCH 1/2] add task solution --- src/splitInteger.test.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index 24003dd5..50ae208d 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -3,11 +3,19 @@ const splitInteger = require('./splitInteger'); test(`should split a number into equal parts - if a value is divisible by a numberOfParts`, () => {}); + 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`, () => {}); + when splitting into 1 part`, () => { + expect(splitInteger(8, 1)).toEqual([8]); +}); -test('should sort parts ascending if they are not equal', () => {}); +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', () => {}); +test('should add zeros if value < numberOfParts', () => { + expect(splitInteger(4, 5)).toEqual([0, 1, 1, 1, 1]); +}); From 3871000876eaf23c01b629c2b44e178f33f49a70 Mon Sep 17 00:00:00 2001 From: Korshun Date: Thu, 8 Oct 2026 14:16:59 +0300 Subject: [PATCH 2/2] add task solution --- src/splitInteger.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index 50ae208d..310a2069 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -17,5 +17,5 @@ test('should sort parts ascending if they are not equal', () => { }); test('should add zeros if value < numberOfParts', () => { - expect(splitInteger(4, 5)).toEqual([0, 1, 1, 1, 1]); + expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); });