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
16 changes: 12 additions & 4 deletions src/arrayReverse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ describe(`Function 'arrayReverse':`, () => {
expect(arrayReverse).toBeInstanceOf(Function);
});

it(`should return an array`, () => {});
it(`should reverse a single word`, () => {
expect(arrayReverse(['Hell0'])).toEqual(['0lleH']);
});
Comment on lines +10 to +12

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 task explicitly provides an example arrayReverse(['Hell0']) === ['0lleH'] that is not currently tested; consider adding a dedicated test case using that exact input and output.


it(`should return an empty string
if original array consists of an empty string`, () => {
it(`should reverse multiple words preserving their original lengths`, () => {
expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']);
});

// write more tests here
it(`should handle a sentence with single letters and punctuation`, () => {
expect(arrayReverse(['I', 'am', 'a', 'student!'])).toEqual([
'!',
'tn',
'e',
'dutsamaI',
]);
});
});
Loading