Skip to content

Commit 550f44d

Browse files
committed
combine tests for number cards and Face cards.
1 parent 5aeb5c0 commit 550f44d

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,15 @@ test("should return 11 for Ace of Spades", () => {
55
expect(aceofSpades).toEqual(11);
66
});
77

8-
test("should return 5 for 5 of Hearts", () => {
9-
const fiveofHearts = getCardValue("5♥");
10-
expect(fiveofHearts).toEqual(5);
8+
test("should return correct values for number cards", () => {
9+
expect(getCardValue("5♥")).toEqual(5);
10+
expect(getCardValue("10♦")).toEqual(10);
1111
});
1212

13-
test("should return 10 for 10 of Diamonds", () => {
14-
const tenofDiamonds = getCardValue("10♦");
15-
expect(tenofDiamonds).toEqual(10);
16-
});
17-
18-
test("should return 10 for Jack of Clubs", () => {
19-
const jackofClubs = getCardValue("J♣");
20-
expect(jackofClubs).toEqual(10);
21-
});
22-
23-
test("should return 10 for Queen of Hearts", () => {
24-
const queenofHearts = getCardValue("Q♥");
25-
expect(queenofHearts).toEqual(10);
26-
});
27-
28-
test("should return 10 for King of Spades", () => {
29-
const kingofSpades = getCardValue("K♠");
30-
expect(kingofSpades).toEqual(10);
13+
test("should return for face cards J, Q, K", () => {
14+
expect(getCardValue("J♣")).toEqual(10);
15+
expect(getCardValue("Q♦")).toEqual(10);
16+
expect(getCardValue("K♠")).toEqual(10);
3117
});
3218

3319
test("throws an error or invalid card", () => {

0 commit comments

Comments
 (0)