diff --git a/src/arrayReverse.test.js b/src/arrayReverse.test.js index cf8ac47..1179ab8 100644 --- a/src/arrayReverse.test.js +++ b/src/arrayReverse.test.js @@ -8,13 +8,35 @@ describe(`Function 'arrayReverse':`, () => { }); it(`should return an array`, () => { - + expect(arrayReverse(['Hello'])).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(['']); }); // write more tests here + it(`should return an array with a reversed string + if original array has only one sentence`, () => { + expect(arrayReverse(['Hell0'])).toEqual(['0lleH']); + }); + + it(`should return an array with reverses + and keep original array string lengths + if original array has two or more sentences`, () => { + expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']); + }); + + it(`should return an array with reverses + and keep original array string lengths + if original array has two or more sentences + (including numbers and punctuation)`, () => { + expect(arrayReverse(['I', 'am', 'a', 'student!'])) + .toEqual(['!', 'tn', 'e', 'dutsamaI']); + }); + + it('should return an empty array if original array is empty', () => { + expect(arrayReverse([])).toEqual([]); + }); });