@@ -78,32 +78,27 @@ describe('minErr', function() {
7878
7979 var myError = testError ( '26' , 'a when objectMaxDepth is default=5 is {0}' , a ) ;
8080 expect ( myError . message ) . toMatch ( / a w h e n o b j e c t M a x D e p t h i s d e f a u l t = 5 i s { " b " : { " c " : { " d " : { " e " : { " f " : " ..." } } } } } / ) ;
81- expect ( errorHandlingConfig ( ) . objectMaxDepth ) . toBe ( 5 ) ;
8281
8382 errorHandlingConfig ( { objectMaxDepth : 1 } ) ;
8483 myError = testError ( '26' , 'a when objectMaxDepth is set to 1 is {0}' , a ) ;
8584 expect ( myError . message ) . toMatch ( / a w h e n o b j e c t M a x D e p t h i s s e t t o 1 i s { " b " : " ..." } / ) ;
86- expect ( errorHandlingConfig ( ) . objectMaxDepth ) . toBe ( 1 ) ;
8785
8886 errorHandlingConfig ( { objectMaxDepth : 2 } ) ;
8987 myError = testError ( '26' , 'a when objectMaxDepth is set to 2 is {0}' , a ) ;
9088 expect ( myError . message ) . toMatch ( / a w h e n o b j e c t M a x D e p t h i s s e t t o 2 i s { " b " : { " c " : " ..." } } / ) ;
91- expect ( errorHandlingConfig ( ) . objectMaxDepth ) . toBe ( 2 ) ;
9289
9390 errorHandlingConfig ( { objectMaxDepth : undefined } ) ;
9491 myError = testError ( '26' , 'a when objectMaxDepth is set to undefined is {0}' , a ) ;
9592 expect ( myError . message ) . toMatch ( / a w h e n o b j e c t M a x D e p t h i s s e t t o u n d e f i n e d i s { " b " : { " c " : " ..." } } / ) ;
96- expect ( errorHandlingConfig ( ) . objectMaxDepth ) . toBe ( 2 ) ;
9793 } ) ;
9894
9995 they ( 'should handle arguments that are objects and ignore max depth when objectMaxDepth = $prop' ,
10096 [ NaN , null , true , false , - 1 , 0 ] , function ( maxDepth ) {
101- var a = { b : { c : { d : 1 } } } ;
97+ var a = { b : { c : { d : { e : { f : { g : 1 } } } } } } ;
10298
10399 errorHandlingConfig ( { objectMaxDepth : maxDepth } ) ;
104100 var myError = testError ( '26' , 'a is {0}' , a ) ;
105- expect ( myError . message ) . toMatch ( / a i s { " b " : { " c " : { " d " : 1 } } } / ) ;
106- expect ( errorHandlingConfig ( ) . objectMaxDepth ) . toBeNaN ( ) ;
101+ expect ( myError . message ) . toMatch ( / a i s { " b " : { " c " : { " d " : { " e " : { " f " : { " g " : 1 } } } } } } / ) ;
107102 }
108103 ) ;
109104
0 commit comments