From 210013e027b060ae950150d7c0fadc360f1b2e39 Mon Sep 17 00:00:00 2001 From: Alyona Shunevych Date: Mon, 4 May 2026 15:41:39 +0300 Subject: [PATCH 1/2] 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..a5c7f66b 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(6, 1)).toEqual([6]); +}); -test('should sort parts ascending if they are not equal', () => {}); +test('should sort parts ascending if they are not equal', () => { + expect(splitInteger(13, 3)).toEqual([4, 4, 5]); +}); -test('should add zeros if value < numberOfParts', () => {}); +test('should add zeros if value < numberOfParts', () => { + expect(splitInteger(3, 4)).toEqual([0, 1, 1, 1]); +}); From af8472400bb673ef237d80eb2d5f5b2c94207b4d Mon Sep 17 00:00:00 2001 From: Alyona Shunevych Date: Mon, 4 May 2026 17:54:47 +0300 Subject: [PATCH 2/2] Solution --- src/splitInteger.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index a5c7f66b..dc3e7aa1 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -9,11 +9,12 @@ 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(13, 3)).toEqual([4, 4, 5]); + 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', () => {