Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 8 additions & 8 deletions src/splitInteger.test.js
Original file line number Diff line number Diff line change
@@ -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(6, 2)).toEqual([3, 3]);
});

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(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]);
});
Comment on lines +19 to 21

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're almost there! The task description requires one more specific example to be tested: splitInteger(32, 6). Please add a new test case for this scenario to ensure the function is fully validated against the requirements.