From d6edb64502c1deef9380c12db099c55640574915 Mon Sep 17 00:00:00 2001 From: Yana Date: Mon, 7 Sep 2026 18:11:22 +0300 Subject: [PATCH] Solution --- src/splitInteger.test.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index 24003dd5..9c2bc523 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -3,11 +3,28 @@ 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`, ( + ) => { + const result = splitInteger(6, 2); + + expect(result).toEqual([3, 3]); + }); test(`should return a part equals to a value - when splitting into 1 part`, () => {}); + when splitting into 1 part`, () => { + const result = splitInteger(8, 1); + + expect(result).toEqual([8]); + }); + +test('should sort parts ascending if they are not equal', () => { + const result = splitInteger(17, 4); + + expect(result).toEqual([4, 4, 4, 5]); +}); -test('should sort parts ascending if they are not equal', () => {}); +test('should add zeros if value < numberOfParts', () => { + const result = splitInteger(3, 5); -test('should add zeros if value < numberOfParts', () => {}); + expect(result).toEqual([0, 0, 1, 1, 1]); +});