Skip to content

Commit 3e3fd1f

Browse files
Node test is passed
1 parent 735b51d commit 3e3fd1f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ test("zero numerator", () => {
2828

2929
test("Negative numerator", () => {
3030
// Example: negative numerator is a proper fraction?
31-
assert.equal(isProperFraction(-2, 3), true);
31+
assert.equal(isProperFraction(-3, 8), true);
32+
assert.equal(isProperFraction(-9, 4), false);
3233
});
3334

3435
test("Negative denominator", () => {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515

1616
export function isProperFraction(numerator, denominator) {
1717
// TODO: Implement this function
18+
if (denominator === 0) {
19+
return false;
20+
}
1821
return Math.abs(numerator) < Math.abs(denominator);
1922
}

0 commit comments

Comments
 (0)