Skip to content

Commit fec9455

Browse files
committed
Write Jest tests to verify function behavior
1 parent f028f06 commit fec9455

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22
// We will use the same function, but write tests for it using Jest in this file.
33
const isProperFraction = require("../implement/2-is-proper-fraction");
44

5-
test("should return true for a proper fraction", () => {
5+
test("should return true for a proper fractions", () => {
66
expect(isProperFraction(2, 3)).toEqual(true);
77
});
88

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

1114
// Case 3: Identify Negative Fractions:
15+
test("should return false for negative fractions", () => {
16+
expect(isProperFraction(-4, 9)).toEqual(true);
17+
})
1218

1319
// Case 4: Identify Equal Numerator and Denominator:
20+
test("should return false for equal numerator and denominator", () => {
21+
expect(isProperFraction(3, 3)).toEqual(false);
22+
})

0 commit comments

Comments
 (0)