Skip to content

Commit 9fc54cf

Browse files
committed
Add jest test for invalid card 'sOup♦', throws error, test passes
1 parent bd931e3 commit 9fc54cf

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ test(`Should throw error when given 's♦'`, () => {
5050
}).toThrow(/Expected a number followed by a suit, but got "s♦"/);
5151
});
5252

53+
test(`Should throw error when given 'sOup♦'`, () => {
54+
expect(() => {
55+
getCardValue("sOup♦");
56+
}).toThrow(/Expected a number followed by a suit, but got "sOup♦"/);
57+
});
58+
59+
5360
// To learn how to test whether a function throws an error as expected in Jest,
5461
// please refer to the Jest documentation:
5562
// https://jestjs.io/docs/expect#tothrowerror

0 commit comments

Comments
 (0)