Skip to content

Commit a104629

Browse files
committed
Fix: Kept the test cases for the invalid characters in rank
1 parent d5f8abe commit a104629

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sprint-3/1-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
@@ -44,6 +44,13 @@ test(`Should throw error for invalid cards`, () => {
4444
expect(() => getCardValue("")).toThrow();
4545
});
4646

47+
test(`Should throw error for extra characters in rank`, () => {
48+
// trailing dot
49+
expect(() => getCardValue("2.♠")).toThrow();
50+
// leading +
51+
expect(() => getCardValue("+2♠")).toThrow();
52+
});
53+
4754
// To learn how to test whether a function throws an error as expected in Jest,
4855
// please refer to the Jest documentation:
4956
// https://jestjs.io/docs/expect#tothrowerror

0 commit comments

Comments
 (0)