Skip to content

Commit 7377c19

Browse files
feat(tests): add tests for adding 2 decimal numbers (#14)
add a missing test case for validating addition of 2 decimal numbers
1 parent 6333c2b commit 7377c19

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/add.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ describe("Test add function", () => {
3434

3535
expect(res).toBe(expected);
3636
});
37+
38+
it("should add two numbers with decimals", () => {
39+
const firstNum = 3.5;
40+
const secondNum = 2.5;
41+
const expected = 6;
42+
43+
const res = add(firstNum, secondNum);
44+
45+
expect(res).toBe(expected);
46+
});
3747
});

0 commit comments

Comments
 (0)