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

it(`should return an array`, () => {});
it(`should return an array`, () => {
const result = arrayReverse(['hello', 'world']);

expect(result).toBeInstanceOf(Array);
});

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

it(`should return a reversed string`, () => {
expect(arrayReverse(['Hell0'])).toEqual(['0lleH']);
});

// write more tests here
it(`should return reversed strings`, () => {
const result = arrayReverse(['Mate', 'Academy']);

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

it(`should return reversed strings right length`, () => {
expect(arrayReverse(['I', 'am', 'a', 'student!'])).toEqual([
'!',
'tn',
'e',
'dutsamaI',
]);
});
});
Loading