Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DianaKhala
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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([]);

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']);

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(['', '']);

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']);

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']);

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.

Comment on lines +37 to +38
expect(arrayReverse(['I', 'am', 'a', 'student!']))
.toEqual(['!', 'tn', 'e', 'dutsamaI']);

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.

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