Skip to content

Commit 3b6f6f7

Browse files
committed
Correct error in invalid cards test for 1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js
1 parent 75ac962 commit 3b6f6f7

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ test(`Should return number when given an a face card (>= 2 && < 10)`, () => {
2424
expect(getCardValue("9♠")).toEqual(9);
2525
});
2626

27-
test(`Should return an error for an invalid card`, () => {
28-
expect(getCardValue("2")).toThrowError();
29-
expect(getCardValue("Q")).toThrowError();
30-
expect(getCardValue("5")).toThrowError();
31-
expect(getCardValue("")).toThrowError();
32-
expect(getCardValue("11♠")).toThrowError();
33-
expect(getCardValue("S♠")).toThrowError();
27+
test(`Should throw for invalid cards`, () => {
28+
expect(() => getCardValue("A")).toThrowError();
29+
expect(() => getCardValue("11♠")).toThrowError();
30+
expect(() => getCardValue("N♠")).toThrowError();
31+
expect(() => getCardValue("7K")).toThrowError();
32+
expect(() => getCardValue("")).toThrowError();
3433
});
3534

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

0 commit comments

Comments
 (0)