Skip to content

Commit 15f3044

Browse files
authored
Update test cases for negative numbers in isProperFraction
Refactor tests for negative numbers to improve clarity and consistency.
1 parent 42e1a89 commit 15f3044

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ test(`should return true when numerator is zero and denominator is non-zero`, ()
3232
});
3333

3434
// Negative numbers
35-
test(`should handle negative numbers correctly`, () => {
36-
expect(isProperFraction(-1, 2)).toEqual(true);
37-
expect(isProperFraction(1, -2)).toEqual(true);
38-
expect(isProperFraction(-3, -2)).toEqual(false);
35+
test("should return true when |numerator| < |denominator| and signs differ", () => {
36+
expect(isProperFraction(-1, 2)).toBe(true);
37+
expect(isProperFraction(1, -2)).toBe(true);
38+
});
39+
40+
test("should return false when |numerator| > |denominator| and both are negative", () => {
41+
expect(isProperFraction(-3, -2)).toBe(false);
3942
});
4043

4144
// Both zero

0 commit comments

Comments
 (0)