Skip to content

Commit 3143f7e

Browse files
created tests for identifying improper fractions and negative proper fractions
1 parent b806538 commit 3143f7e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

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

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

1114
// Case 3: Identify Negative Fractions:
15+
test("should return true for a negative numerator proper fraction", () => {
16+
expect(isProperFraction(-2, 3)).toEqual(true);
17+
});
18+
test("should return true for a negative denominator proper fraction", () => {
19+
expect(isProperFraction(2, -3)).toEqual(true);
20+
});
21+
test("should return true for both negative numerator and denominator proper fraction", () => {
22+
expect(isProperFraction(-2, -3)).toEqual(true);
23+
});
1224

1325
// Case 4: Identify Equal Numerator and Denominator:
26+
test("should return false for equal numerator and denominator", () => {
27+
expect(isProperFraction(2, 2)).toEqual(false);
28+
});

0 commit comments

Comments
 (0)