Skip to content

Commit 9246d8b

Browse files
Fix incorrect descriptions for negative fraction test cases
1 parent 3368371 commit 9246d8b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
function isProperFraction(numerator, denominator) {
1414
if (denominator === 0) {
1515
return false;
16-
} {
17-
return Math.abs(numerator) < Math.abs(denominator);
1816
}
17+
return Math.abs(numerator) < Math.abs(denominator);
18+
1919
}
2020

2121
// The line below allows us to load the isProperFraction function into tests in other files.

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@ test(`should return false when numerator is greater than denominator`, () => {
2020
test(`should return false when numerator is equals to denominator`, () => {
2121
expect(isProperFraction(3, 3)).toEqual(false);
2222
});
23-
test(`should return true when denominator is greater than negative numerator`, () => {
23+
test("should return true when abs(numerator) < abs(denominator)", () => {
2424
expect(isProperFraction(-1, 2)).toEqual(true);
25-
});
26-
test(`should return false when numerator is greater than denominator`, () => {
2725
expect(isProperFraction(1, -2)).toEqual(true);
28-
});
29-
test(`should return false when negative numerator is greater than negative denominator`, () => {
3026
expect(isProperFraction(-1, -2)).toEqual(true);
3127
});

0 commit comments

Comments
 (0)