Finish quiz 2

This commit is contained in:
Isaac
2022-10-26 10:18:05 -03:00
parent 9a62c4918f
commit e18f58c0d0
2 changed files with 18 additions and 1 deletions

View File

@ -16,5 +16,15 @@
function() {
let obj = [1, 2, [-6, 2, -2], 3]
expect(sum.objectSum(obj)).toBe(0);
});
});
it("Lists",
function() {
let obj = {a: 1, b: 2, c: 3}
expect(sum.objectSum(obj)).toBe(6);
});
it("Recursive lists",
function() {
let obj = [1, 2, {thing: [-6, -12], other: 6}]
expect(sum.objectSum(obj)).toBe(-9);
});
});