Passed final tests for exercise 05
This commit is contained in:
parent
77972b4282
commit
c47a205e6f
|
@ -1,5 +1,5 @@
|
||||||
const sumAll = function(a, b) {
|
const sumAll = function(a, b) {
|
||||||
if (a < 0 || b < 0) {
|
if (a < 0 || b < 0 || typeof(a) != "number"|| typeof(b) != "number") {
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
}
|
}
|
||||||
let c, sum = 0;
|
let c, sum = 0;
|
||||||
|
|
|
@ -13,10 +13,10 @@ describe('sumAll', () => {
|
||||||
test('returns ERROR with negative numbers', () => {
|
test('returns ERROR with negative numbers', () => {
|
||||||
expect(sumAll(-10, 4)).toEqual('ERROR');
|
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');
|
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');
|
expect(sumAll(10, [90, 1])).toEqual('ERROR');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue