Skip to content

Commit 49baa11

Browse files
committed
wrote a test for an array with negative numbers, test passed
1 parent 43647bb commit 49baa11

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Sprint-1/implement/sum.test.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ test("should return the number when given one number", () => {
2828
// Given an array containing negative numbers
2929
// When passed to the sum function
3030
// Then it should still return the correct total sum
31+
test("should return the number when given negative numbers ", () => {
32+
expect(sum([10, -4, 5, 7])).toEqual(18);
33+
expect(sum([-3, -4, -6, -9])).toEqual(-22);
34+
expect(sum([7, -9, 2, 1])).toEqual(1);
35+
});
3136

3237
// Given an array with decimal/float numbers
3338
// When passed to the sum function

0 commit comments

Comments
 (0)