Skip to content

Commit e5af9d8

Browse files
authored
responding to the valuable comments
1 parent 99f9720 commit e5af9d8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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
@@ -15,7 +15,7 @@ function isProperFraction(numerator, denominator) {
1515
return false;
1616
}
1717
if (numerator === denominator) {
18-
return true;
18+
return false;
1919
}
2020
if (numerator === 0) {
2121
return true;
@@ -67,7 +67,7 @@ assertEquals(negativeFraction, true);
6767
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.
6868
const equalFraction = isProperFraction(3, 3);
6969
// ====> complete with your assertion
70-
assertEquals(equalFraction, true);
70+
assertEquals(equalFraction, false);
7171

7272
// Stretch:
7373
// What other scenarios could you test for?

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ test("should return 11 for Ace of Diamonds", () => {
3737
expect(getCardValue("A♦")).toEqual(11);
3838
});
3939
// Case 5: Handle Invalid Cards:
40-
test("should return null for invalid card 'B'", () => {
41-
expect(getCardValue("Z♠")).toBeNull();
42-
});
40+
test("should throw an error for invalid card 'Z♠'", () => {
41+
expect(() => getCardValue("Z♠")).toThrow("Invalid card");
42+
});

0 commit comments

Comments
 (0)