Skip to content

Develop#175

Open
AlbinaAlbi wants to merge 2 commits intomate-academy:mainfrom
AlbinaAlbi:develop
Open

Develop#175
AlbinaAlbi wants to merge 2 commits intomate-academy:mainfrom
AlbinaAlbi:develop

Conversation

@AlbinaAlbi
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.

Review Summary

Great work on this task! The implementation of arrayReverse is correct and successfully meets all the functional requirements. Your tests cover the necessary cases, including the examples from the description and important edge cases.

I am approving your solution, but please pay close attention to the feedback on your tests in src/arrayReverse.test.js. Several test descriptions are inaccurate and do not reflect what the test is actually asserting. For example, the test described as handling an empty string actually tests two different non-empty arrays, and another description incorrectly states that spaces are kept in place.

Clear and accurate test descriptions are crucial as they act as documentation. For future projects, ensure each it block tests a single, specific scenario and that its description precisely matches the assertion. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment on lines 14 to +23
it(`should return an empty string
if original array consists of an empty string`, () => {
expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']);
let result = arrayReverse(['Mate', 'Academy']);

expect(result).toEqual(['ymed', 'acAetaM']);

result = arrayReverse(['I', 'am', 'a', 'student!']);

expect(result).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 description for this test case is misleading. It states that it tests for an empty string, but it actually verifies two of the main examples from the task description. For better readability and maintenance, it's a good practice to test a single scenario per it block. Please split this into two separate tests with accurate descriptions.

expect(result).toEqual(['!', 'tn', 'e', 'dutsamaI']);
});

it('should keep non-empty strings reversed', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description 'should keep non-empty strings reversed' is unclear. A good test description should clearly state the scenario being tested. A better description here would be something like 'should correctly handle an array that includes an empty string'.

});

// write more tests here
it('should reverse only non-empty strings and keep spaces in place', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test description is inaccurate. The function does not 'keep spaces in place'; spaces are reversed along with all other characters. An accurate description would be 'should correctly handle strings containing spaces'.

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