Skip to content

Commit 342e00a

Browse files
authored
Update 3-get-card-value.test.js
1 parent d60f640 commit 342e00a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ test(`Should return 11 when given an ace card`, () => {
1111

1212
// Suggestion: Group the remaining test data into these categories:
1313
// Number Cards (2-10)
14+
test(`Should throw an error when given an invalid suit`, () => {
15+
expect(() => getCardValue("2X")).toThrow("Invalid card");
16+
expect(() => getCardValue("5Z")).toThrow("Invalid card");
17+
});
18+
1419
test(`Should return the numeric value for number cards`, () => {
1520
expect(getCardValue("2♠")).toEqual(2);
1621
expect(getCardValue("3♠")).toEqual(3);

0 commit comments

Comments
 (0)