Develop#1104
Conversation
Fix linter error in the task file
Feature/prettier
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because the core splitInteger implementation is correct and your Jest tests cover the main behavioral rules (correct length, ascending order, max–min difference ≤ 1, and edge cases like value < numberOfParts). The only gap identified is that some explicit example inputs from the task description (splitInteger(6, 2), splitInteger(17, 4), splitInteger(32, 6)) are not yet asserted in src/splitInteger.test.js, but this is a coverage improvement rather than a functional blocker. To strengthen your test suite, you should add expectations like expect(splitInteger(6, 2)).toEqual([3, 3]) and similarly for the other two examples, ideally in their own it blocks near your existing tests. This will more directly tie your tests to the specification examples and improve confidence that future changes won’t break documented behaviors. Overall, you’ve met the functional and checklist requirements, and the project structure and configuration (ESLint, Jest, workflow) are set up appropriately. Nice work validating both typical and edge-case scenarios; extending tests to include those explicit examples would be a good next refinement step.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| test(`should split a number into equal parts | ||
| if a value is divisible by a numberOfParts`, () => { | ||
|
|
||
| test('should split a number into equal parts if divisible', () => { |
There was a problem hiding this comment.
The task description includes explicit example behaviours (e.g. splitInteger(6, 2), splitInteger(17, 4), splitInteger(32, 6)) that are not currently covered by tests. Consider adding expectations for these inputs so the test suite fully reflects the required behaviour.
| expect(splitInteger(10, 2)).toEqual([5, 5]); | ||
| expect(splitInteger(12, 3)).toEqual([4, 4, 4]); |
There was a problem hiding this comment.
To align with the examples in the description, you should also test splitInteger(6, 2) and splitInteger(17, 4) here or in an additional test block, ensuring the function matches [3, 3] and [4, 4, 4, 5] respectively.
| test('should return a part equal to a value for 1 part', () => { | ||
| expect(splitInteger(8, 1)).toEqual([8]); |
There was a problem hiding this comment.
Besides splitInteger(8, 1), the description requires verifying splitInteger(32, 6) === [5, 5, 5, 5, 6, 6]. Add this case to ensure the implementation is tested against all specified examples.
No description provided.