Created some tests for the function#187
Created some tests for the function#187GeorgeSavostikov wants to merge 2 commits intomate-academy:mainfrom
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on writing tests for the basic functionality and edge cases like empty arrays! However, the current test suite is missing coverage for some key requirements mentioned in the task description. Your tests currently only cover inputs with lowercase letters.
Please update src/arrayReverse.test.js to include test cases for strings that contain:
- Numbers
- Special symbols
- Mixed-case letters
A good starting point is to add tests for the examples provided in the task description, such as ['Hell0'], ['Mate', 'Academy'], and ['I', 'am', 'a', 'student!']. This will ensure your function correctly handles all specified input types.
✨ 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
| describe('arrayReverse', () => { | ||
| const arrayReverse = require('./arrayReverse'); | ||
|
|
||
| it(`should be declared`, () => { | ||
| expect(arrayReverse).toBeInstanceOf(Function); | ||
| }); | ||
|
|
||
| it(`should return an array`, () => {}); | ||
| it(`should return an array`, () => { | ||
| expect(arrayReverse([])).toBeInstanceOf(Array); | ||
| }); | ||
|
|
||
| it(`should return an empty string if original array consists of an empty string`, () => { | ||
| expect(arrayReverse([''])).toEqual(['']); | ||
| }); | ||
|
|
||
| it(`should reverse letters in a single word`, () => { | ||
| expect(arrayReverse(['abc'])).toEqual(['cba']); | ||
| }); | ||
|
|
||
| it(`should reverse letters in multiple words`, () => { | ||
| expect(arrayReverse(['abc', 'def'])).toEqual(['fed', 'cba']); | ||
| }); | ||
|
|
||
| it(`should handle words of different lengths`, () => { | ||
| expect(arrayReverse(['a', 'bc', 'def'])).toEqual(['f', 'ed', 'cba']); | ||
| }); | ||
|
|
||
| it(`should return an empty string | ||
| if original array consists of an empty string`, () => { | ||
| expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']); | ||
| it(`should handle array with empty strings in between`, () => { | ||
| expect(arrayReverse(['a', '', 'bc'])).toEqual(['c', '', 'ba']); | ||
| }); | ||
|
|
||
| // write more tests here | ||
| it(`should handle array with all empty strings`, () => { | ||
| expect(arrayReverse(['', '', ''])).toEqual(['', '', '']); | ||
| }); | ||
|
|
||
| it(`should handle single-character words`, () => { | ||
| expect(arrayReverse(['x', 'y', 'z'])).toEqual(['z', 'y', 'x']); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
The current tests only use lowercase letters. According to the task description, the input strings can also contain numbers, special symbols, and mixed-case letters. Please add test cases to cover these scenarios. A good starting point would be to add tests for the examples provided in the task description: ['Hell0'], ['Mate', 'Academy'], and ['I', 'am', 'a', 'student!'].
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this iteration! I am approving your solution as you have successfully addressed all the feedback from the previous review. You've added a comprehensive set of test cases that cover strings with numbers, special symbols, and mixed-case letters. It's also great to see that you've included tests for all the examples provided in the task description, making the test suite robust and complete. Keep up the fantastic work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.