From 371e4a0b6f52c6e22ce7d815be3d2544b4d5315e Mon Sep 17 00:00:00 2001 From: Vlad Mitlosh Date: Sun, 22 Feb 2026 14:27:41 +0200 Subject: [PATCH 1/3] solution --- package-lock.json | 3 ++- package.json | 2 +- src/splitInteger.test.js | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 79127efc..f6abf20a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "eslint": "^5.16.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-node": "^8.0.1", - "jest": "^24.5.0" + "jest": "^24.9.0" } }, "node_modules/@babel/code-frame": { @@ -3567,6 +3567,7 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-24.9.0.tgz", "integrity": "sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw==", "dev": true, + "license": "MIT", "dependencies": { "import-local": "^2.0.0", "jest-cli": "^24.9.0" diff --git a/package.json b/package.json index f782ac5a..077b4aee 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "eslint": "^5.16.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-node": "^8.0.1", - "jest": "^24.5.0" + "jest": "^24.9.0" }, "mateAcademy": { "projectType": "javascript" diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index a610317d..28355910 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(12, 3)).toEqual([4, 4, 4]); }); test(`should return a part equals to a value when splitting into 1 part`, () => { - + expect(splitInteger(12, 1)).toEqual([12]); }); test('should sort parts ascending if they are not equal', () => { - + expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]); }); test('should add zeros if value < numberOfParts', () => { - + expect(splitInteger(3, 5)).toEqual([0, 0, 1, 1, 1]); }); From e063eee696e748dbca8c5045c0d3e0b68de27c7b Mon Sep 17 00:00:00 2001 From: Vlad Mitlosh Date: Sun, 22 Feb 2026 14:40:27 +0200 Subject: [PATCH 2/3] solution --- src/splitInteger.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index 28355910..d915228c 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -1,21 +1,21 @@ -'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(12, 3)).toEqual([4, 4, 4]); + expect(splitInteger(6, 2)).toEqual([3, 3]); }); test(`should return a part equals to a value when splitting into 1 part`, () => { - expect(splitInteger(12, 1)).toEqual([12]); + 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]); }); -test('should add zeros if value < numberOfParts', () => { +test("should add zeros if value < numberOfParts", () => { expect(splitInteger(3, 5)).toEqual([0, 0, 1, 1, 1]); }); From 7c8ce62fdeef6843f902fa5d199c3d1297760d33 Mon Sep 17 00:00:00 2001 From: Vlad Mitlosh Date: Sun, 22 Feb 2026 15:12:09 +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 d915228c..9f708f43 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -13,7 +13,7 @@ test(`should return a part equals to a value }); 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", () => {