Skip to content

Commit c68a37c

Browse files
committed
Sprint-3 rewrite-tests-with-jest/2-get-card-value.test.js. rewrote tests using jest
1 parent 4930742 commit c68a37c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

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

1010
// Case 2: Handle Number Cards (2-10):
11+
test("should number cards for (2-10)", () => {
12+
const aceofSpades = getCardValue("5♠");
13+
expect(aceofSpades).toEqual(5);
14+
});
15+
1116
// Case 3: Handle Face Cards (J, Q, K):
17+
test("should return 10 for face cards", () => {
18+
const aceofSpades = getCardValue("Q♠");
19+
expect(aceofSpades).toEqual(10);
20+
});
1221
// Case 4: Handle Ace (A):
22+
// test("should return 11 for Ace of Spades", () => {
23+
// const aceofSpades = getCardValue("A♠");
24+
// expect(aceofSpades).toEqual(11);
25+
// });
1326
// Case 5: Handle Invalid Cards:
27+
test("should throw an error for invalid cards", () => {
28+
expect(() => getCardValue("Z♠")).toThrow("Invalid Card");
29+
});
30+
// Sprint-3 rewrite-tests-with-jest/2-get-card-value.test.js. rewrote tests using jest

0 commit comments

Comments
 (0)