-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests for arrayReverse.test.js #117
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the arrayReverse
function! 🎉 Your code meets the task requirements and constraints effectively. While there was a minor misunderstanding in the test expectations regarding the order of strings, your solution is correct. Keep up the good work, and consider adjusting the test cases to ensure they fully align with the task description in future projects. Happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -8,13 +8,33 @@ describe(`Function 'arrayReverse':`, () => { | |||
}); | |||
|
|||
it(`should return an array`, () => { | |||
const result = arrayReverse([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case should check if the order of the strings is also reversed, not just the strings themselves. According to the task description, the function should reverse the strings and their order.
}); | ||
|
||
it(`should return an array with each string reversed`, () => { | ||
expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected result should reflect both the reversal of strings and their order. The current expectation only reverses the strings but not their order.
}); | ||
|
||
it(`should return an empty string | ||
if original array consists of an empty string`, () => { | ||
expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']); | ||
expect(arrayReverse(['', ''])).toEqual(['', '']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case should also consider reversing the order of the strings, even if they are empty.
// write more tests here | ||
it(`should return an array with each string reversed | ||
including digits`, () => { | ||
expect(arrayReverse(['Hell0'])).toEqual(['0lleH']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the test case checks for both reversed strings and reversed order.
|
||
it(`should return an array with each string reversed | ||
including special characters`, () => { | ||
expect(arrayReverse(['Hell@'])).toEqual(['@lleH']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected result should include both reversed strings and reversed order.
expect(arrayReverse(['I', 'am', 'a', 'student!'])) | ||
.toEqual(['!', 'tn', 'e', 'dutsamaI']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected result should reflect both the reversal of strings and their order. The current expectation only reverses the strings but not their order.
No description provided.