From e6f6d47d613e1a953a587c9e192da56c75de4abd Mon Sep 17 00:00:00 2001 From: Yurii Kumpanenko Date: Mon, 4 May 2026 14:13:48 +0300 Subject: [PATCH] add task solution --- src/arrayReverse.test.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/arrayReverse.test.js b/src/arrayReverse.test.js index 6e7ca36..903f9d6 100644 --- a/src/arrayReverse.test.js +++ b/src/arrayReverse.test.js @@ -7,12 +7,28 @@ describe(`Function 'arrayReverse':`, () => { expect(arrayReverse).toBeInstanceOf(Function); }); - it(`should return an array`, () => {}); + it(`should return an array`, () => { + expect(Array.isArray(arrayReverse([]))).toBe(true); + }); 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 reverse string if original array consists one string`, () => { + expect(arrayReverse(['Hell0'])).toEqual(['0lleH']); }); - // write more tests here + it(`should return strings with changed length in original order if there is more than one`, () => { + expect(arrayReverse(['Mate', 'Academy'])).toEqual(['ymed', 'acAetaM']); + + // eslint-disable-next-line max-len, prettier/prettier + expect(arrayReverse(['I', 'am', 'a', 'student!'])).toEqual([ + '!', + 'tn', + 'e', + 'dutsamaI', + ]); + }); });