Skip to content

Created some tests for the function#187

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

Created some tests for the function#187
GeorgeSavostikov wants to merge 2 commits intomate-academy:mainfrom
GeorgeSavostikov:develop

Conversation

@GeorgeSavostikov
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

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines +3 to 41
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']);
});
});
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 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!'].

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

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! ✨

Footnotes

  1. Rate AI review example

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