Skip to content

Commit 34ae0f2

Browse files
Fixed the logic bug( a misplced parenthesis
1 parent bfb2769 commit 34ae0f2

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,27 @@ test(`Should return 11 when given an ace card`, () => {
1111

1212
// Suggestion: Group the remaining test data into these categories:
1313
// Number Cards (2-10)
14-
test(`Should return the correct value for number cards (2-10)`), () => {
14+
test(`Should return the correct value for number cards (2-10)`, () => {
1515
expect(getCardValue("2♠")).toEqual(2);
1616
expect(getCardValue("5♠")).toEqual(5);
1717
expect(getCardValue("10♠")).toEqual(10);
18-
}
18+
})
1919
// Face Cards (J, Q, K)
20-
test(`Should return 10 when given a face card (J, Q, K)`), () => {
20+
test(`Should return 10 when given a face card (J, Q, K)`, () => {
2121
expect(getCardValue("J♠")).toEqual(10);
2222
expect(getCardValue("Q♠")).toEqual(10);
2323
expect(getCardValue("K♠")).toEqual(10);
24-
}
24+
})
2525
// Invalid Card suits
26-
test(`Should throw an error when given an invalid card suit`), () => {
26+
test(`Should throw an error when given an invalid card suit`, () => {
2727
expect(() => getCardValue("3-")).toThrow("Invalid card rank");
28-
expect(() => getCardValue("5X")).toThrow("Invalid card suit");
28+
expect(() => getCardValue("5X")).toThrow("Invalid card suit")});
2929

3030
// Invalid Card ranks
31-
test(`Should throw an error when given an invalid card rank`), () => {
31+
test(`Should throw an error when given an invalid card rank`, () => {
3232
expect(() => getCardValue("1♠")).toThrow("Invalid card rank");
3333
expect(() => getCardValue("11♠")).toThrow("Invalid card rank");
34-
}
34+
})
3535

3636
// To learn how to test whether a function throws an error as expected in Jest,
3737
// please refer to the Jest documentation:

0 commit comments

Comments
 (0)