From c47a205e6f8000b557c6d5516322c70b2a157195 Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Fri, 5 Jan 2024 21:56:46 +0100 Subject: [PATCH] Passed final tests for exercise 05 --- 05_sumAll/sumAll.js | 2 +- 05_sumAll/sumAll.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/05_sumAll/sumAll.js b/05_sumAll/sumAll.js index 8ee567f..f578c17 100644 --- a/05_sumAll/sumAll.js +++ b/05_sumAll/sumAll.js @@ -1,5 +1,5 @@ const sumAll = function(a, b) { - if (a < 0 || b < 0) { + if (a < 0 || b < 0 || typeof(a) != "number"|| typeof(b) != "number") { return "ERROR"; } let c, sum = 0; diff --git a/05_sumAll/sumAll.spec.js b/05_sumAll/sumAll.spec.js index 7927aae..a171e5f 100644 --- a/05_sumAll/sumAll.spec.js +++ b/05_sumAll/sumAll.spec.js @@ -13,10 +13,10 @@ describe('sumAll', () => { test('returns ERROR with negative numbers', () => { expect(sumAll(-10, 4)).toEqual('ERROR'); }); - test.skip('returns ERROR with non-number parameters', () => { + test('returns ERROR with non-number parameters', () => { expect(sumAll(10, "90")).toEqual('ERROR'); }); - test.skip('returns ERROR with non-number parameters', () => { + test('returns ERROR with non-number parameters', () => { expect(sumAll(10, [90, 1])).toEqual('ERROR'); }); });