Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/arrayReverse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ describe(`Function 'arrayReverse':`, () => {
expect(arrayReverse).toBeInstanceOf(Function);
});

it(`should return an array`, () => {

});

it(`should return an empty string
if original array consists of an empty string`, () => {
expect(arrayReverse(['', ''])).toEqual(['', '']);
});
Comment on lines +12 to +13

Choose a reason for hiding this comment

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

Potential misunderstanding of the requirement: The test expects ['', ''] as output when the input is ['', ''], but the description says it should return an empty string if the original array consists of an empty string. Please clarify whether the expected output should be [''], '', or ['', ''] according to the task requirements.


it('should reverse strings', () => {
expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']);
});

// write more tests here
it('should reverse strings with special symbols', () => {
expect(arrayReverse(['1', ' ', '2345', ' 6 ', '7']))
.toEqual(['7', ' ', '6 54', '32 ', '1']);
});
});