File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,27 @@ const getCardValue = require("../implement/3-get-card-value");
88test ( `Should return 11 when given an ace card` , ( ) => {
99 expect ( getCardValue ( "A♠" ) ) . toEqual ( 11 ) ;
1010} ) ;
11-
11+ test ( `should return 9 when given a 9♠ card` , ( ) => {
12+ expect ( getCardValue ( "9♠" ) ) . toEqual ( 9 ) ;
13+ } ) ;
14+ test ( `should return 10 when given a face card K♦` , ( ) => {
15+ expect ( getCardValue ( "K♦" ) ) . toEqual ( 10 ) ;
16+ } ) ;
17+ test ( `should return 10 when given a 10` , ( ) => {
18+ expect ( getCardValue ( "10♥" ) ) . toEqual ( 10 ) ;
19+ } ) ;
20+ test ( `should throw error for invalid Ranks` , ( ) => {
21+ expect ( ( ) => getCardValue ( "11♠" ) ) . toThrow ( ) ;
22+ } ) ;
23+ test ( `should throw error for invalid Suits` , ( ) => {
24+ expect ( ( ) => getCardValue ( "A?" ) ) . toThrow ( ) ;
25+ } ) ;
26+ test ( `should throw error for missing Suits` , ( ) => {
27+ expect ( ( ) => getCardValue ( "A" ) ) . toThrow ( ) ;
28+ } ) ;
29+ test ( `should throw error for non String input` , ( ) => {
30+ expect ( ( ) => getCardValue ( "10" ) ) . toThrow ( ) ;
31+ } ) ;
1232// Suggestion: Group the remaining test data into these categories:
1333// Number Cards (2-10)
1434// Face Cards (J, Q, K)
You can’t perform that action at this time.
0 commit comments