From 3cc5cf5d9668e3349cd87db5660cef3bed09179b Mon Sep 17 00:00:00 2001 From: Olena7202 Date: Fri, 20 Feb 2026 12:14:46 +0200 Subject: [PATCH] add task solution --- src/splitInteger.test.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index a610317d..a04cf56f 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -4,18 +4,22 @@ 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]); + expect(splitInteger(10, 5)).toEqual([2, 2, 2, 2, 2]); }); test(`should return a part equals to a value when splitting into 1 part`, () => { - + expect(splitInteger(8, 1)).toEqual([8]); + expect(splitInteger(100, 1)).toEqual([100]); }); 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', () => { - + expect(splitInteger(3, 5)).toEqual([0, 0, 1, 1, 1]); + expect(splitInteger(2, 4)).toEqual([0, 0, 1, 1]); });