Skip to content

Commit 0e18f06

Browse files
committed
wrote tests for proper fraction function
1 parent 58b4b7e commit 0e18f06

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

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

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

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

1114
// Case 3: Identify Negative Fractions:
12-
15+
test("should return true for a negative proper fraction", () => {
16+
expect(isProperFraction(-4, 7)).toEqual(true);
17+
});
1318
// Case 4: Identify Equal Numerator and Denominator:
19+
test("should return false when numerator equals denominator", () => {
20+
expect(isProperFraction(3, 3)).toEqual(false);
21+
});
22+
23+
// Case 5: Zero Numerator:
24+
test("should return true for zero numerator", () => {
25+
expect(isProperFraction(0, 5)).toEqual(true);
26+
});
27+
28+
// Case 6: Zero Denominator:
29+
test("should return false for zero denominator", () => {
30+
expect(isProperFraction(4, 0)).toEqual(false);
31+
});
32+
33+
// Case 7: Negative Denominator:
34+
test("should return true for negative denominator", () => {
35+
expect(isProperFraction(3, -5)).toEqual(true);
36+
});

0 commit comments

Comments
 (0)