Skip to content

Commit 0492fb4

Browse files
Add additional test cases for isProperFraction function to cover improper fractions, negative fractions, and equal numerator and denominator scenarios
1 parent 7049b83 commit 0492fb4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

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

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

1114
// Case 3: Identify Negative Fractions:
15+
test("should return true when the absolute value of the numerator is smaller than the absolute value of the denominator",()=>{
16+
expect(isProperFraction(-2,9)).toEqual(true);
17+
expect(isProperFraction(2,-9)).toEqual(true)
18+
expect(isProperFraction(-2,-9)).toEqual(true)
19+
})
1220

1321
// Case 4: Identify Equal Numerator and Denominator:
22+
test("should return false for equal numerator and denominator ",()=>{
23+
expect(isProperFraction(1,1)).toEqual(false)
24+
expect(isProperFraction(-1, 1)).toEqual(false);
25+
})

0 commit comments

Comments
 (0)