Skip to content

Solution#1039

Open
pryge wants to merge 2 commits intomate-academy:mainfrom
pryge:develop
Open

Solution#1039
pryge wants to merge 2 commits intomate-academy:mainfrom
pryge:develop

Conversation

@pryge
Copy link

@pryge pryge commented Nov 18, 2025

No description provided.

Copy link

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

Choose a reason for hiding this comment

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

Review Summary

I am requesting a few changes before this can be approved. You've done a great job setting up the tests, but the test suite is incomplete as it's missing tests for some of the examples provided in the task description. Please add test cases for splitInteger(17, 4) and splitInteger(32, 6) to ensure the function is fully validated. Additionally, the descriptions for your first two tests appear to be swapped, which is a bit confusing. The test for splitInteger(8, 1) should describe splitting into one part, while the test for splitInteger(6, 2) is a good example of an evenly divisible value. Once you've added the missing tests and corrected the descriptions, your solution will be ready!


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines 5 to 7
test(`should split a number into equal parts
if a value is divisible by a numberOfParts`, () => {

expect(splitInteger(8, 1)).toEqual([8]);

Choose a reason for hiding this comment

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

The test description is about a value being divisible, but the test case splitInteger(8, 1) is more about the special case where numberOfParts is 1. Consider making the description more specific to what is being tested.

Comment on lines 10 to 12
test(`should return a part equals to a value
when splitting into 1 part`, () => {

expect(splitInteger(6, 2)).toEqual([3, 3]);

Choose a reason for hiding this comment

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

The test description says this is for splitting into 1 part, but the code splitInteger(6, 2) splits the value into 2 parts. This test is a good example of splitting a value that is evenly divisible, which seems to match the description of your first test.

Copy link

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

Choose a reason for hiding this comment

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

Review Summary

Great work on this iteration! You've successfully addressed the previous feedback by adding the missing test cases and correcting the descriptions. Your solution meets all the requirements, and I am happy to approve it.

Just a small note for future reference: the description for your final test case is a bit misleading.

it('should add zeros if value < numberOfParts', ...)

This description doesn't quite match the test case splitInteger(32, 6), since 32 is not less than 6. A more accurate description would reflect that this is another test for splitting a value that isn't evenly divisible. Since this is a minor issue with a description and doesn't affect the test's correctness, it's not a blocker.

Excellent job getting this completed!


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

Footnotes

  1. Rate AI review example

expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]);
});

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

Choose a reason for hiding this comment

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

This test description doesn't seem to match the test case. The test uses splitInteger(32, 6), where the value is not less than numberOfParts, and the expected result doesn't involve zeros. Could you update the description to accurately reflect what this test is verifying?

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.

2 participants