Skip to content

Commit 191c314

Browse files
authored
Update 2-is-proper-fraction.test.js
1 parent 8a2c4f0 commit 191c314

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,32 @@ const isProperFraction = require("../implement/2-is-proper-fraction");
88
test(`should return false when denominator is zero`, () => {
99
expect(isProperFraction(1, 0)).toEqual(false);
1010
});
11+
12+
test("1/2 is proper", () => {
13+
expect(isProperFraction(1, 2)).toBe(true);
14+
});
15+
16+
test("3/2 is improper", () => {
17+
expect(isProperFraction(3, 2)).toBe(false);
18+
});
19+
20+
test("0/5 is proper", () => {
21+
expect(isProperFraction(0, 5)).toBe(true);
22+
});
23+
24+
test("denominator 0 is invalid", () => {
25+
expect(isProperFraction(1, 0)).toBe(false);
26+
});
27+
28+
test("-1/2 is proper", () => {
29+
expect(isProperFraction(-1, 2)).toBe(true);
30+
});
31+
32+
test("1/-2 is proper", () => {
33+
expect(isProperFraction(1, -2)).toBe(true);
34+
});
35+
36+
test("-3/2 is improper", () => {
37+
expect(isProperFraction(-3, 2)).toBe(false);
38+
});
39+

0 commit comments

Comments
 (0)