Skip to content

Commit 0e4389e

Browse files
committed
test: add Jest tests for isProperFraction and verify functionality
1 parent 5e53e5d commit 0e4389e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@ test("should return true for a proper fraction", () => {
77
});
88

99
// Case 2: Identify Improper Fractions:
10+
test("should return false,for Improper Fractions (4/2) ", () => {
11+
expect(isProperFraction(4, 2)).toEqual(false);
12+
});
1013

1114
// Case 3: Identify Negative Fractions:
15+
test("should return true for Negative proper fraction", () => {
16+
expect(isProperFraction(1, -8)).toEqual(true);
17+
});
18+
19+
test("should return true for Negative proper fraction", () => {
20+
expect(isProperFraction(-7, -9)).toEqual(true);
21+
});
1222

1323
// Case 4: Identify Equal Numerator and Denominator:
24+
test("should return fals for not proper fraction(0/0)", () => {
25+
expect(isProperFraction(0, 0)).toEqual(false);
26+
});
27+
28+
test("should return fals for not proper fraction(5/5)", () => {
29+
expect(isProperFraction(5, 5)).toEqual(false);
30+
});

0 commit comments

Comments
 (0)