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
29 changes: 26 additions & 3 deletions src/arrayReverse.test.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

twoje 2 nowe testy sa dobre, ale wszystkie 3 przypadki to tablice z wieloma slowami. brakuje jednego slowa, np. ['Hell0'] -> ['0lleH'] z readme, oraz przypadku z pustym stringiem. bez nich zla implementacja moze dalej przechodzic.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,35 @@ describe(`Function 'arrayReverse':`, () => {
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(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']);
expect(arrayReverse([''])).toEqual(['']);
});

it(`should work with symbols and numbers`, () => {
expect(arrayReverse(['I', '@m', 'here', 'to', 'ch€ck'])).toEqual([
'k',
'c€',
'hcot',
'er',
'ehm@I',
]);
});

// write more tests here
it(`should work with one word inside an array`, () => {
expect(arrayReverse(['Hell0'])).toEqual(['0lleH']);
});

it(`should respect the amount of letters in words`, () => {
expect(arrayReverse(['Good', 'sentence', 'to', 'reverse'])).toEqual([
'esre',
'verotecn',
'et',
'nesdooG',
]);
});
});
Loading