Skip to content

Commit 508372f

Browse files
committed
Add Jest tests for isproperfraction function
1 parent 7b6de53 commit 508372f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

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

99
// Case 2: Identify Improper Fractions:
10-
10+
test("should return false when numerator is greater than denominator", () => {
11+
expect(isProperFraction(5, 2)).toEqual(false);
12+
});
1113
// Case 3: Identify Negative Fractions:
12-
14+
test("should return true when absolute numerator is less than absolute denominator", () => {
15+
expect(isProperFraction(-4, 7)).toEqual(true);
16+
});
1317
// Case 4: Identify Equal Numerator and Denominator:
18+
test("should return false when numerator equals denominator", () => {
19+
expect(isProperFraction(3, 3)).toEqual(false);
20+
});

0 commit comments

Comments
 (0)