Skip to content

Commit 7ffe0a6

Browse files
committed
fixed the space between lines and made it clear
1 parent 6557f26 commit 7ffe0a6

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function assertEquals(actualOutput, targetOutput) {
3737
`Expected ${actualOutput} to equal ${targetOutput}`
3838
);
3939
}
40+
4041
// Acceptance criteria:
4142

4243
// 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),
@@ -57,17 +58,17 @@ assertEquals(fiveOfHearts, 5);
5758
// Given a card with a rank of "10," "J," "Q," or "K",
5859
// When the function is called with such a card,
5960
// Then it should return the value 10, as these cards are worth 10 points each in blackjack.
60-
const tenofDiamonds = getCardValue("10♦");
61-
assertEquals(tenofDiamonds, 10);
61+
const tenOfDiamonds = getCardValue("10♦");
62+
assertEquals(tenOfDiamonds, 10);
6263

6364
const jackOfClubs = getCardValue("J♣");
6465
assertEquals(jackOfClubs, 10);
6566

66-
const queensOfSpades = getCardValue("Q♠")
67-
assertEquals(queensOfSpades, 10);
67+
const queenOfSpades = getCardValue("Q♠");
68+
assertEquals(queenOfSpades, 10);
6869

69-
const kingOfHeart = getCardValue("K♥");
70-
assertEquals(kingOfHeart, 10);
70+
const kingOfHearts = getCardValue("K♥");
71+
assertEquals(kingOfHearts, 10);
7172

7273
// Handle Ace (A):
7374
// Given a card with a rank of "A",
@@ -78,8 +79,9 @@ assertEquals(kingOfHeart, 10);
7879
// Given a card with an invalid rank (neither a number nor a recognized face card),
7980
// When the function is called with such a card,
8081
// Then it should throw an error indicating "Invalid card rank."
82+
8183
try {
82-
getCardValue("1♠"); // invalid rank
84+
getCardValue("1♠");
8385
console.error("Test failed: invalid card did not throw error");
8486
} catch (error) {
8587
console.log("Invalid card test passed");

0 commit comments

Comments
 (0)