Skip to content

Commit da74f22

Browse files
Implement proper fraction & tests
1 parent 152dbbb commit da74f22

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,19 @@ test("Basic proper fraction", () => {
1010
// Example: 1/2 is a proper fraction
1111
assert.equal(isProperFraction(1, 2), true);
1212
});
13+
14+
test("Basic proper fraction 2/5", () => {
15+
assert.equal(isProperFraction(2, 5), true);
16+
});
17+
18+
test("Basic proper fraction 3/5", () => {
19+
assert.equal(isProperFraction(3, 5), true);
20+
});
21+
22+
test("Checks equal numerator & denominator 5/5", () => {
23+
assert.equal(isProperFraction(5, 5), false);
24+
});
25+
26+
test("Checks numerator greater than denominator 7/5", () => {
27+
assert.equal(isProperFraction(7, 5), false);
28+
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
// execute the code to ensure all tests pass.
1515

1616
export function isProperFraction(numerator, denominator) {
17-
// TODO: Implement this function
17+
return numerator < denominator;
1818
}

0 commit comments

Comments
 (0)