@@ -11,27 +11,27 @@ test(`Should return 11 when given an ace card`, () => {
1111
1212// Suggestion: Group the remaining test data into these categories:
1313// Number Cards (2-10)
14- test ( `Should return the correct value for number cards (2-10)` ) , ( ) => {
14+ test ( `Should return the correct value for number cards (2-10)` , ( ) => {
1515 expect ( getCardValue ( "2♠" ) ) . toEqual ( 2 ) ;
1616 expect ( getCardValue ( "5♠" ) ) . toEqual ( 5 ) ;
1717 expect ( getCardValue ( "10♠" ) ) . toEqual ( 10 ) ;
18- }
18+ } )
1919// Face Cards (J, Q, K)
20- test ( `Should return 10 when given a face card (J, Q, K)` ) , ( ) => {
20+ test ( `Should return 10 when given a face card (J, Q, K)` , ( ) => {
2121 expect ( getCardValue ( "J♠" ) ) . toEqual ( 10 ) ;
2222 expect ( getCardValue ( "Q♠" ) ) . toEqual ( 10 ) ;
2323 expect ( getCardValue ( "K♠" ) ) . toEqual ( 10 ) ;
24- }
24+ } )
2525// Invalid Card suits
26- test ( `Should throw an error when given an invalid card suit` ) , ( ) => {
26+ test ( `Should throw an error when given an invalid card suit` , ( ) => {
2727 expect ( ( ) => getCardValue ( "3-" ) ) . toThrow ( "Invalid card rank" ) ;
28- expect ( ( ) => getCardValue ( "5X" ) ) . toThrow ( "Invalid card suit" ) ;
28+ expect ( ( ) => getCardValue ( "5X" ) ) . toThrow ( "Invalid card suit" ) } ) ;
2929
3030// Invalid Card ranks
31- test ( `Should throw an error when given an invalid card rank` ) , ( ) => {
31+ test ( `Should throw an error when given an invalid card rank` , ( ) => {
3232 expect ( ( ) => getCardValue ( "1♠" ) ) . toThrow ( "Invalid card rank" ) ;
3333 expect ( ( ) => getCardValue ( "11♠" ) ) . toThrow ( "Invalid card rank" ) ;
34- }
34+ } )
3535
3636// To learn how to test whether a function throws an error as expected in Jest,
3737// please refer to the Jest documentation:
0 commit comments