Skip to content

js_split_integer #1094

Open
zhyliaieva wants to merge 6 commits into
mate-academy:developfrom
zhyliaieva:main
Open

js_split_integer #1094
zhyliaieva wants to merge 6 commits into
mate-academy:developfrom
zhyliaieva:main

Conversation

@zhyliaieva

Copy link
Copy Markdown

js_split_integer

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

The request meets the required criteria for approval.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread src/splitInteger.test.js
Comment on lines 5 to +6
test(`should split a number into equal parts
if a value is divisible by a numberOfParts`, () => {

});
if a value is divisible by a numberOfParts`, () => {});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty test body - need to add assertions. For example: expect(splitInteger(8, 1)).toEqual([8]);

Comment thread src/splitInteger.test.js
Comment on lines 8 to +9
test(`should return a part equals to a value
when splitting into 1 part`, () => {

});

test('should sort parts ascending if they are not equal', () => {

});
when splitting into 1 part`, () => {});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty test body - need to add assertions. For example: expect(splitInteger(6, 2)).toEqual([3, 3]);

Comment thread src/splitInteger.test.js
when splitting into 1 part`, () => {});

test('should add zeros if value < numberOfParts', () => {
test('should sort parts ascending if they are not equal', () => {});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty test body - need to add assertions to verify the array is sorted ascending and max-min <= 1. For example: expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]);

Comment thread src/splitInteger.test.js
test('should sort parts ascending if they are not equal', () => {});

});
test('should add zeros if value < numberOfParts', () => {});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty test body - need to add assertions. When value < numberOfParts, the function should still return exactly numberOfParts elements (with zeros for remaining parts). For example: expect(splitInteger(3, 5)).toEqual([0, 0, 1, 1, 1]);

Comment thread .eslintrc.js
Comment on lines 5 to 6
},
rules: {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test body is empty. Add expectations like expect(splitInteger(6, 2)).toEqual([3, 3]) to verify equal splitting behavior.

Comment thread .eslintrc.js
Comment on lines 8 to 9
},
plugins: ['jest']

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test body is empty. Add an expectation such as expect(splitInteger(8, 1)).toEqual([8]) to verify single-part behavior.

Comment on lines +5 to 6
branches: [ main ]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test body is empty. Add assertions using expect() to verify the function returns equal parts when divisible. For example: expect(splitInteger(6, 2)).toEqual([3, 3])

@@ -11,7 +11,7 @@ jobs:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test body is empty. Add assertions to verify the array is sorted in ascending order. For example: expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]) - note the values are already ascending.

@@ -11,7 +11,7 @@ jobs:

strategy:
matrix:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test body is empty. Add assertions to verify the function handles cases where value < numberOfParts (should add zeros). For example: splitInteger(2, 5) should return [0, 0, 0, 1, 1].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants