Skip to content

Solution added#1073

Open
dminikulin wants to merge 3 commits intomate-academy:mainfrom
dminikulin:develop
Open

Solution added#1073
dminikulin wants to merge 3 commits intomate-academy:mainfrom
dminikulin:develop

Conversation

@dminikulin
Copy link

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

This is a great start on the tests, and you've covered several important cases. However, a couple of adjustments are needed before this can be approved.

Your test for splitInteger(6, 2) currently only checks the length of the result, which doesn't fully validate the output. Please update the assertion to check that the array's content is exactly [3, 3], for example, by using toEqual([3, 3]).

Additionally, the test suite is missing a required case from the task description: splitInteger(17, 4). Please add a test for this scenario to ensure full coverage of the requirements.


✨ 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

if a value is divisible by a numberOfParts`, () => {
const result = splitInteger(6, 2);

expect(result).toHaveLength(2);

Choose a reason for hiding this comment

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

This assertion checks only the length of the resulting array. According to the task requirements, you should verify the exact content of the array, which should be [3, 3] for this test case.

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

Excellent work addressing the feedback and ensuring the test suite covers all requirements! Your solution works perfectly, so I am approving it.

I have one small suggestion for future improvement. In src/splitInteger.test.js, two tests share the same description. It's a good practice to give each test a unique name, for example, test('should correctly split 32 into 6 parts'). This helps to quickly identify which specific scenario is failing if a test breaks.

This is just a minor point on best practices. Great job on this task!


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

Footnotes

  1. Rate AI review example

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

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

Choose a reason for hiding this comment

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

This test has the same description as the one on line 19. It's a good practice to give each test a unique and descriptive name. This helps in quickly identifying which scenario is failing.

For example, you could change this to something like: test('should correctly split 32 into 6 parts').

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