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'); }); });