Skip to content

Solution#189

Open
BadOfficer wants to merge 1 commit intomate-academy:mainfrom
BadOfficer:develop
Open

Solution#189
BadOfficer wants to merge 1 commit intomate-academy:mainfrom
BadOfficer:develop

Conversation

@BadOfficer
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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

Your Jest tests for arrayReverse cover the core required behavior (function existence, return type, preservation of original string lengths, and the main example cases), so the solution can move forward as submitted. The main thing to improve is the test in src/arrayReverse.test.js whose description says "should return an empty string if original array consists of an empty string" but whose assertion actually checks arrayReverse(['Mate', 'Academy']) and expects ['ymed', 'acAetaM']; updating either the test title to describe that multi-word behavior, or the assertion to actually test [''] -> [''], will remove this confusion. As a minor enhancement for coverage, consider adding explicit tests for arrayReverse(['']) and arrayReverse([]) so the empty-string and empty-array edge cases are clearly specified. It would also be helpful to clarify in one test description whether the array order is expected to change or stay the same, since your examples keep the original order even though some wording of the task might suggest reversing the array itself. Overall, the test suite is well-structured and validates the key algorithm; tightening these descriptions and edge cases will make it even clearer for future readers.


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

Footnotes

  1. Rate AI review example

Comment thread src/arrayReverse.test.js
const result = arrayReverse(['a', 'b', 'c']);

expect(Array.isArray(result)).toBeTruthy();
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The test title says: "should return an empty string if original array consists of an empty string", but the assertion checks arrayReverse(['Mate', 'Academy']) expecting ['ymed', 'acAetaM']. This is inconsistent and confusing. Either update the test title to describe the actual assertion (e.g., "should reverse strings and preserve lengths for multiple words") or change the assertion to actually test the empty-string case (for example expect(arrayReverse([''])).toEqual([''])) if that behavior should be covered.

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