Skip to content

Commit 55184b4

Browse files
committed
Add a case of 0 as the denominator
1 parent 7e9f694 commit 55184b4

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎implement-and-rewrite-tests/implement-tests-with-node-test/2-is-proper-fraction.test.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ test("Improper fraction with equal values", () => {
3838
test("Proper fraction with zero numerator", () => {
3939
assert.equal(isProperFraction(0, 4), true);
4040
});
41+
42+
test("Improper fraction with zero denominator", () => {
43+
assert.equal(isProperFraction(4, 0), false);
44+
});

‎implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ test(`should return false when denominator is zero`, () => {
77
expect(isProperFraction(1, 0)).toEqual(false);
88
});
99

10+
test(`should return true when numerator is zero`, () => {
11+
expect(isProperFraction(0, 1)).toEqual(true);
12+
});
13+
1014
test(`should return true when numerator is less than denominator`, () => {
1115
expect(isProperFraction(1, 2)).toEqual(true);
1216
});

0 commit comments

Comments
 (0)