Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on setting up a comprehensive test suite with many edge cases! However, some changes are needed before this can be approved.
The main issue is that the test for reversing an array with multiple strings has an incorrect expected value. According to the task, the logic is to join all strings, reverse the combined string, and then split it back into parts with the same lengths as the original strings. For the input ["It's not a lake,", " ", "it's an ocean"], the expected output should be ["naeco na s'ti ,ek", "a", "l a ton s'tI"].
Additionally, please add tests for all the specific examples provided in the task description, such as arrayReverse(['Hell0']), to ensure full coverage of the requirements. Once these tests are corrected and added, 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
src/arrayReverse.test.js
Outdated
| it(`should return array with reversed words | ||
| if original array consists of several words`, () => { | ||
| expect(arrayReverse([`It's not a lake,`, ` `, `it's an ocean`])) | ||
| .toEqual([`naeco na s'ti ,e`, `k`, `al a ton s'tI`]); |
There was a problem hiding this comment.
This expected output appears to be incorrect based on the rules in the task description. The logic should be:
- Join the array into a single string:
"It's not a lake, it's an ocean" - Reverse this string:
"naeco na s'ti ,ekal a ton s'tI" - Split the reversed string back into an array, using the lengths of the original strings
[17, 1, 14].
The correct result should be ["naeco na s'ti ,ek", "a", "l a ton s'tI"].
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this revision! I'm happy to approve your solution. You've successfully addressed all the feedback from the previous review, correcting the test cases and ensuring all required examples from the task description are included. The test suite is now comprehensive and correctly validates the function's behavior. Well done!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.