We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f195fc commit db40788Copy full SHA for db40788
Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
@@ -18,7 +18,7 @@ function getCardValue(card) {
18
} else if (!isNaN(rank) && Number(rank) >= 2 && Number(rank) <= 9) {
19
return Number(rank);
20
} else {
21
- throw new Error("Invalid card rank");
+ throw new Error('Invalid card rank: "${rank}"'); //rather than just "Invalid card rank" we can show the actual rank that was invalid
22
}
23
24
@@ -84,7 +84,7 @@ try {
84
console.assert(false, "Expected an error to be thrown for invalid card rank");
85
} catch (e) {
86
console.assert(
87
- e.message === "Invalid card rank",
+ e.message === 'Invalid card rank: "${rank}"',
88
`Expected error message to be "Invalid card rank" but got "${e.message}"`
89
);
90
0 commit comments