Skip to content

Commit fd49b18

Browse files
committed
the proper fraction test is corrected
1 parent 36c74ca commit fd49b18

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ function getCardValue(card) {
2121
else {
2222
return "Invalid card rank."
2323
}
24-
// for (let i=1; i<10; i++){
25-
// if (i==5){
26-
// return rank === "5"
27-
// }
28-
// }
24+
2925
}
3026

3127
// The line below allows us to load the getCardValue 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: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ test("should return true for a proper fraction", () => {
77
});
88

99
// Case 2: Identify Improper Fractions:
10-
test("should return false for numerato>denominator",()=>{
10+
test("should return false for numerator>denominator",()=>{
1111
expect(isProperFraction(5, 2)).toEqual(false);
1212
} );
1313

1414
// Case 3: Identify Negative Fractions:
15-
test ("should return true for negative Fraction",()=>{
16-
expect(isProperFraction(-4,7)).toEqual(true);
15+
test("should return true when the fraction is negative but proper (numerator smaller than denominator in absolute value)", () => {
16+
expect(isProperFraction(-4, 7)).toEqual(true);
17+
});
18+
19+
20+
test("should return false when the numerator is negative and greater in absolute value than the denominator", () => {
21+
expect(isProperFraction(-3, 2)).toEqual(false);
1722
});
1823

1924
// Case 4: Identify Equal Numerator and Denominator:

0 commit comments

Comments
 (0)