Skip to content

Commit 69ddec4

Browse files
committed
Write Jest test cases for getCardValue function implementation
1 parent 0032765 commit 69ddec4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ test("should return 11 for Ace of Spades", () => {
88
});
99

1010
// Case 2: Handle Number Cards (2-10):
11+
// test("should return 10 for number cards from 1 to 10", () => {
12+
// const numberCards = getCardValue("8♥");
13+
// expect(numberCards.toEqual(10));
14+
// })
1115
// Case 3: Handle Face Cards (J, Q, K):
1216
// Case 4: Handle Ace (A):
1317
// Case 5: Handle Invalid Cards:
18+
test("should return invalid card rank for random numbers", () => {
19+
const invalidRandomCard = getCardValue("85♠");
20+
expect(invalidRandomCard).toEqual("Invalid card rank.");
21+
});

0 commit comments

Comments
 (0)