You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The line below allows us to load the getCardValue function into tests in other files.
@@ -31,20 +42,32 @@ function assertEquals(actualOutput, targetOutput) {
31
42
// Given a card string in the format "A♠" (representing a card in blackjack - the last character will always be an emoji for a suit, and all characters before will be a number 2-10, or one letter of J, Q, K, A),
32
43
// When the function getCardValue is called with this card string as input,
33
44
// Then it should return the numerical card value
34
-
constaceofSpades=getCardValue("A♠");
35
-
assertEquals(aceofSpades,11);
45
+
constaceOfSpades=getCardValue("A♠");
46
+
assertEquals(aceOfSpades,11);
36
47
37
48
// Handle Number Cards (2-10):
38
49
// Given a card with a rank between "2" and "9",
39
50
// When the function is called with such a card,
40
51
// Then it should return the numeric value corresponding to the rank (e.g., "5" should return 5).
41
-
constfiveofHearts=getCardValue("5♥");
52
+
constfiveOfHearts=getCardValue("5♥");
53
+
assertEquals(fiveOfHearts,5);
42
54
// ====> write your test here, and then add a line to pass the test in the function above
43
55
44
56
// Handle Face Cards (J, Q, K):
45
57
// Given a card with a rank of "10," "J," "Q," or "K",
46
58
// When the function is called with such a card,
47
59
// Then it should return the value 10, as these cards are worth 10 points each in blackjack.
0 commit comments