File tree Expand file tree Collapse file tree 1 file changed +25
-9
lines changed
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest Expand file tree Collapse file tree 1 file changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,31 @@ test(`Should return 10 when given a face card`, () => {
2424} ) ;
2525
2626// Case 4: Invalid Cards
27- test ( `Should return Invalid Card when given an invalid card` , ( ) => {
28- expect ( getCardValue ( "Aas♠" ) ) . toEqual ( "Invalid card" ) ;
29- expect ( getCardValue ( "What" ) ) . toEqual ( "Invalid card" ) ;
30- expect ( getCardValue ( "Q10" ) ) . toEqual ( "Invalid card" ) ;
31- expect ( getCardValue ( "11" ) ) . toEqual ( "Invalid card" ) ;
32- expect ( getCardValue ( "♠11" ) ) . toEqual ( "Invalid card" ) ;
33- expect ( getCardValue ( "10*" ) ) . toEqual ( "Invalid card" ) ;
34- expect ( getCardValue ( "Q_" ) ) . toEqual ( "Invalid card" ) ;
35- expect ( getCardValue ( "A10" ) ) . toEqual ( "Invalid card" ) ;
27+ test ( `Should return Error when given an invalid card` , ( ) => {
28+ expect ( ( ) => {
29+ getCardValue ( "Aas♠" ) ;
30+ } ) . toThrow ( ) ;
31+ expect ( ( ) => {
32+ getCardValue ( "What" ) ;
33+ } ) . toThrow ( ) ;
34+ expect ( ( ) => {
35+ getCardValue ( "Q10" ) ;
36+ } ) . toThrow ( ) ;
37+ expect ( ( ) => {
38+ getCardValue ( "11" ) ;
39+ } ) . toThrow ( ) ;
40+ expect ( ( ) => {
41+ getCardValue ( "♠11" ) ;
42+ } ) . toThrow ( ) ;
43+ expect ( ( ) => {
44+ getCardValue ( "10*" ) ;
45+ } ) . toThrow ( ) ;
46+ expect ( ( ) => {
47+ getCardValue ( "Q_" ) ;
48+ } ) . toThrow ( ) ;
49+ expect ( ( ) => {
50+ getCardValue ( "A10" ) ;
51+ } ) . toThrow ( ) ;
3652} ) ;
3753
3854// Suggestion: Group the remaining test data into these categories:
You can’t perform that action at this time.
0 commit comments