From b4ec63ac240405b13017a6866c3c5c3b9c9c9dab Mon Sep 17 00:00:00 2001 From: Ernesto Gonzalez <60261375+UmiKami@users.noreply.github.com> Date: Thu, 13 Jul 2023 01:26:39 +0000 Subject: [PATCH] added tests that check for some negatives and all negatives input --- .../109-getLargestElementAtProperty/test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/exercises/109-getLargestElementAtProperty/test.js b/exercises/109-getLargestElementAtProperty/test.js index fc4753bcf..56550b236 100644 --- a/exercises/109-getLargestElementAtProperty/test.js +++ b/exercises/109-getLargestElementAtProperty/test.js @@ -35,6 +35,22 @@ test('The function must return the largest element of the array located in the k expect(output).toBe(15); }); +test('The function must return the largest element of the array located in the key. Testing with some negative values.', () => { + let obj = { + key: [5, 4, 15, -3, -20, 80], + }; + let output = getLargestElementAtProperty(obj, 'key'); + expect(output).toBe(80); +}); + +test('The function must return the largest element of the array located in the key. Testing with all negative values.', () => { + let obj = { + key: [-5, -4, -15, -3, -20, -80], + }; + let output = getLargestElementAtProperty(obj, 'key'); + expect(output).toBe(-3); +}); + test('If the array is empty, it should return an empty array', () => { let obj = { key: [],