Skip to content

Commit 2dcf042

Browse files
committed
I have correct the error
1 parent 2e49fad commit 2dcf042

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ if (angle === 180) {
3737
if (angle < 360) {
3838
return "reflext angle";
3939
}
40-
40+
module.exports = getAngleType;
4141
// TODO: Implement this function
4242

4343
// The line below allows us to load the getAngleType function into tests in other files.
4444
// This will be useful in the "rewrite tests with jest" step.
45-
module.exports = getAngleType;
45+
4646

4747
// This helper function is written to make our assertions easier to read.
4848
// If the actual output matches the target output, the test will pass

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
// execute the code to ensure all tests pass.
1212

1313
function isProperFraction(numerator, denominator) {
14-
// TODO: Implement this function
14+
15+
if (numerator < denominator) {
16+
return true;
17+
} else {
18+
return false;
19+
}
1520
}
21+
// TODO: Implement this function
22+
1623

1724
// The line below allows us to load the isProperFraction function into tests in other files.
1825
// This will be useful in the "rewrite tests with jest" step.
@@ -29,5 +36,17 @@ function assertEquals(actualOutput, targetOutput) {
2936
// TODO: Write tests to cover all cases.
3037
// What combinations of numerators and denominators should you test?
3138

39+
//test
3240
// Example: 1/2 is a proper fraction
3341
assertEquals(isProperFraction(1, 2), true);
42+
// Proper fractions
43+
assertEquals(isProperFraction(1, 2), true);
44+
assertEquals(isProperFraction(3, 5), true);
45+
46+
// Not proper fractions
47+
assertEquals(isProperFraction(5, 5), false);
48+
assertEquals(isProperFraction(7, 3), false);
49+
50+
// Edge case
51+
assertEquals(isProperFraction(0, 5), true);
52+
What the function does

0 commit comments

Comments
 (0)