From 23d066e1902c5eba7bb76ed9cd6f5021e4fedb31 Mon Sep 17 00:00:00 2001 From: Vasyl Pylypchynets Date: Tue, 28 Oct 2025 10:44:19 +0200 Subject: [PATCH 1/3] add src --- 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..8b5b8ac9 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(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); }); test(`should return a part equals to a value when splitting into 1 part`, () => { - + expect(splitInteger(32, 1)).toEqual([32]); }); test('should sort parts ascending if they are not equal', () => { - + expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); }); test('should add zeros if value < numberOfParts', () => { - + expect(splitInteger(4, 7)).toEqual([0, 0, 0, 1, 1, 1, 1]); }); From 4694896ad33623230a6a625432e9d5915dfc63ad Mon Sep 17 00:00:00 2001 From: Vasyl Pylypchynets Date: Tue, 28 Oct 2025 10:57:48 +0200 Subject: [PATCH 2/3] solution --- src/splitInteger.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index 8b5b8ac9..8c89672d 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -4,16 +4,16 @@ const splitInteger = require('./splitInteger'); test(`should split a number into equal parts if a value is divisible by a numberOfParts`, () => { - expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); + expect(splitInteger(6, 2)).toEqual([3, 3]); }); test(`should return a part equals to a value when splitting into 1 part`, () => { - expect(splitInteger(32, 1)).toEqual([32]); + expect(splitInteger(10, 1)).toEqual([10]); }); test('should sort parts ascending if they are not equal', () => { - expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); + expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]); }); test('should add zeros if value < numberOfParts', () => { From c29a1b977a86b180c87f427e9c374230e31fb1f7 Mon Sep 17 00:00:00 2001 From: Vasyl Pylypchynets Date: Tue, 28 Oct 2025 11:01:56 +0200 Subject: [PATCH 3/3] 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 8c89672d..10adc1b2 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -9,7 +9,7 @@ test(`should split a number into equal parts test(`should return a part equals to a value when splitting into 1 part`, () => { - expect(splitInteger(10, 1)).toEqual([10]); + expect(splitInteger(8, 1)).toEqual([8]); }); test('should sort parts ascending if they are not equal', () => {