Passes test 1 and 2 from exercise 05

This commit is contained in:
NetMan 2024-01-05 21:37:06 +01:00
parent a308d40fee
commit 43e2839177
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
const sumAll = function() { const sumAll = function(a, b) {
let sum = 0;
for (let i = a; i <= b; i++) {
sum += i;
}
return sum;
}; };
// Do not edit below this line // Do not edit below this line

View File

@ -4,7 +4,7 @@ describe('sumAll', () => {
test('sums numbers within the range', () => { test('sums numbers within the range', () => {
expect(sumAll(1, 4)).toEqual(10); expect(sumAll(1, 4)).toEqual(10);
}); });
test.skip('works with large numbers', () => { test('works with large numbers', () => {
expect(sumAll(1, 4000)).toEqual(8002000); expect(sumAll(1, 4000)).toEqual(8002000);
}); });
test.skip('works with larger number first', () => { test.skip('works with larger number first', () => {