Skip to content

Commit 142c282

Browse files
committed
fix throw error and test
1 parent 4472fa2 commit 142c282

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,3 @@ function assertEquals(actualOutput, targetOutput) {
9898
// getCardValue("5*");
9999
// getCardValue("10H");
100100
// getCardValue("QS");
101-
102-
getCardValue("1♠");

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ test("should return error for invalid cards", () => {
2727
expect(() => {
2828
getCardValue("1♠");
2929
}).toThrow("Invalid card");
30-
// expect(getCardValue("1♠")).toEqual(0);
31-
// expect(getCardValue("11♣")).toEqual(0);
32-
// expect(getCardValue("X♦")).toEqual(0);
33-
// expect(getCardValue("")).toEqual(0);
30+
expect(() => {
31+
getCardValue("11♠");
32+
}).toThrow("Invalid card");
33+
expect(() => {
34+
getCardValue("X♦");
35+
}).toThrow("Invalid card");
36+
expect(() => {
37+
getCardValue("");
38+
}).toThrow("Invalid card");
3439
});
3540

3641
// Suggestion: Group the remaining test data into these categories:

0 commit comments

Comments
 (0)