Skip to content

added tests#1103

Open
yahohulia wants to merge 1 commit into
mate-academy:mainfrom
yahohulia:develop
Open

added tests#1103
yahohulia wants to merge 1 commit into
mate-academy:mainfrom
yahohulia:develop

Conversation

@yahohulia

Copy link
Copy Markdown

No description provided.

@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

Your solution is approved because the core splitInteger implementation correctly satisfies the task’s functional requirements: it returns an array of integers of the requested length, sorted ascending, with the difference between the maximum and minimum elements never exceeding 1. The existing tests in src/splitInteger.test.js already exercise key behaviors such as equal splits, single-part splits, ordering, and the value < numberOfParts case, and they are consistent with the described algorithm.

The main missing pieces are not critical blockers but opportunities to strengthen your test coverage. Specifically, consider adding a dedicated test for the documented example splitInteger(32, 6) to assert [5, 5, 5, 5, 6, 6], and optionally a more general test that checks Math.max(parts) - Math.min(parts) <= 1 across a range of input values. You could also add a small test for splitInteger(6, 2) to fully mirror all examples in the task description. Overall, you’ve implemented the required functionality well; tightening the tests will further improve confidence in your solution.


✨ 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
});

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.

The task description includes an explicit example splitInteger(32, 6) === [5, 5, 5, 5, 6, 6], but there is no corresponding test here; consider adding a test case for that example to fully cover the specified behavior.

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