diff --git a/src/arrayReverse.test.js b/src/arrayReverse.test.js index 6e7ca36..e8c8b83 100644 --- a/src/arrayReverse.test.js +++ b/src/arrayReverse.test.js @@ -7,12 +7,42 @@ describe(`Function 'arrayReverse':`, () => { expect(arrayReverse).toBeInstanceOf(Function); }); - it(`should return an array`, () => {}); + it(`should return an array`, () => { + expect(Array.isArray(arrayReverse(['Hell0']))).toBe(true); + }); + + it(`should return an empty string if original array consists of an empty string`, () => { + expect(arrayReverse([''])).toEqual(['']); + }); - it(`should return an empty string - if original array consists of an empty string`, () => { + it(`should reverse one string in array`, () => { + expect(arrayReverse(['Hell0'])).toEqual(['0lleH']); + }); + + it(`should reverse strings and their order`, () => { expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']); }); - // write more tests here + it(`should keep original strings lengths after reverse`, () => { + expect(arrayReverse(['I', 'am', 'a', 'student!'])).toEqual([ + '!', + 'tn', + 'e', + 'dutsamaI', + ]); + }); + + it(`should work with numbers and special symbols`, () => { + expect(arrayReverse(['12', '@#$%', 'abc'])).toEqual(['cb', 'a%$#', '@21']); + }); + + it(`should work with multiple empty strings`, () => { + expect(arrayReverse(['', '', ''])).toEqual(['', '', '']); + }); + + it(`should not change array length`, () => { + const result = arrayReverse(['Mate', 'Academy']); + + expect(result.length).toBe(2); + }); });