From 98f087b973d7c6efa89f3d41c187cbf4621c4a5c Mon Sep 17 00:00:00 2001 From: Csillag61 Date: Sun, 25 May 2025 19:02:22 -0400 Subject: [PATCH] splitInteger_test --- src/splitInteger.test.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index a610317d..be2baa03 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -1,21 +1,23 @@ -'use strict'; +"use strict"; -const splitInteger = require('./splitInteger'); +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]); }); -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]); + expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); }); -test('should add zeros if value < numberOfParts', () => { - +test("should add zeros if value < numberOfParts", () => { + expect(splitInteger(3, 5)).toEqual([0, 0, 1, 1, 1]); });