Skip to content

Commit e21d0fd

Browse files
committed
tests to include negative numerator and denominator cases
1 parent 595de00 commit e21d0fd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ test("should return true when numerator is zero and denominator is negative", ()
1717
test("should return true when numerator is less than denominator", () => {
1818
expect(isProperFraction(1, 2)).toBe(true);
1919
expect(isProperFraction(3, 5)).toBe(true);
20+
expect(isProperFraction(-1, 2)).toBe(true);
21+
expect(isProperFraction(1, -2)).toBe(true);
2022
});
2123

2224
// Category 3: Improper fractions (numerator >= denominator)
2325
test("should return false when numerator is greater than or equal to denominator", () => {
2426
expect(isProperFraction(2, 1)).toBe(false);
2527
expect(isProperFraction(5, 5)).toBe(false);
28+
expect(isProperFraction(-3, 2)).toBe(false);
29+
expect(isProperFraction(3, -2)).toBe(false);
2630
});
2731

2832
// Category 4: Denominator is zero

0 commit comments

Comments
 (0)