Skip to content

Commit 1f7930b

Browse files
committed
Add jest test fir invalid card '-3♦', throws error, test passes
1 parent 9fc54cf commit 1f7930b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎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
@@ -56,6 +56,11 @@ test(`Should throw error when given 'sOup♦'`, () => {
5656
}).toThrow(/Expected a number followed by a suit, but got "sOup♦"/);
5757
});
5858

59+
test(`Should throw error when given '-3♦'`, () => {
60+
expect(() => {
61+
getCardValue("-3♦");
62+
}).toThrow(/Expected a number followed by a suit, but got "-3♦"/);
63+
});
5964

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

0 commit comments

Comments
 (0)