Skip to content

Commit 32055e1

Browse files
rewrote test to check an invalid card when rank is numeric 1
1 parent cf96c14 commit 32055e1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ test(`Should return 10 when given a K card`, () => {
5353
expect(getCardValue("K♠")).toEqual(10);
5454
});
5555
// Invalid Cards
56+
test(`Should throw an error when given an invalid card`, () => {
57+
expect(() => getCardValue("1♠")).toThrow("Invalid rank");
58+
});
5659

5760
// To learn how to test whether a function throws an error as expected in Jest,
5861
// please refer to the Jest documentation:

0 commit comments

Comments
 (0)