Skip to content

Commit 76ad0cc

Browse files
committed
made the Error message simplier
1 parent f14ee5c commit 76ad0cc

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
// write one test at a time, and make it pass, build your solution up methodically
99
// just make one change at a time -- don't rush -- programmers are deep and careful thinkers
1010
function getCardValue(card) {
11-
const errorMessage =
12-
"Error: Invalid card rank. Input should be a string in the format 'R♠', where R is 2-10, J, Q, K, or A, followed by either ♠, ♥, ♦, or ♣.";
11+
const errorMessage = "Error: Invalid card rank";
1312

1413
if (typeof card !== "string" || card.length < 2) {
1514
return errorMessage;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ test("should return 11 for Ace of Hearts", () => {
4343
expect(aceOfHearts).toEqual(11);
4444
});
4545
// Case 5: Handle Invalid Cards:
46-
const errorMessage =
47-
"Error: Invalid card rank. Input should be a string in the format 'R♠', where R is 2-10, J, Q, K, or A, followed by either ♠, ♥, ♦, or ♣.";
46+
const errorMessage = "Error: Invalid card rank";
4847

4948
test("should throw an error for invalid card rank", () => {
5049
const invalidCard = getCardValue("1♠");

0 commit comments

Comments
 (0)