Skip to content

Commit f33a9a9

Browse files
authored
Added proper fraction test
Fix typos in test cases and improve assertions for the isProperFraction function.
1 parent f376a88 commit f33a9a9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Implement a function isProperFraction,
1+
(properfraction (// Implement a function isProperFraction,
22
// when given two numbers, a numerator and a denominator, it should return true if
33
// the given numbers form a proper fraction, and false otherwise.
44

@@ -36,15 +36,17 @@ function assertEquals(actualOutput, targetOutput) {
3636
// Example: 1/2 is a proper fraction
3737
assertEquals(isProperFraction(1, 2), true);
3838
//Test
39-
// Proper fraction 3/5
39+
// Proper fraction
4040
assertEqual(isproperFraction(3,5), true);
41-
assertEual(isProperFraction(4/8), true);
41+
assertEual(isProperFraction(4,8), true);
42+
assertEqual(isproperfraction (-1,-2) false);
43+
4244

4345
//Not
44-
assertEqual(isproperFraction(9,7),false);
46+
assertEqual(isproperFraction(9/7),false);
4547
assertEqual(isproperFracton(13/11),false);
4648

4749
//Edge case
48-
assertEqual(isperoperFractio(0,5),true);
50+
assertEqual(isperoperFractio(0/5),true);
4951

5052

0 commit comments

Comments
 (0)