@@ -78,32 +78,27 @@ describe('minErr', function() {
78
78
79
79
var myError = testError ( '26' , 'a when objectMaxDepth is default=5 is {0}' , a ) ;
80
80
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 ) ;
82
81
83
82
errorHandlingConfig ( { objectMaxDepth : 1 } ) ;
84
83
myError = testError ( '26' , 'a when objectMaxDepth is set to 1 is {0}' , a ) ;
85
84
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 ) ;
87
85
88
86
errorHandlingConfig ( { objectMaxDepth : 2 } ) ;
89
87
myError = testError ( '26' , 'a when objectMaxDepth is set to 2 is {0}' , a ) ;
90
88
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 ) ;
92
89
93
90
errorHandlingConfig ( { objectMaxDepth : undefined } ) ;
94
91
myError = testError ( '26' , 'a when objectMaxDepth is set to undefined is {0}' , a ) ;
95
92
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 ) ;
97
93
} ) ;
98
94
99
95
they ( 'should handle arguments that are objects and ignore max depth when objectMaxDepth = $prop' ,
100
96
[ 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 } } } } } } ;
102
98
103
99
errorHandlingConfig ( { objectMaxDepth : maxDepth } ) ;
104
100
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 } } } } } } / ) ;
107
102
}
108
103
) ;
109
104
0 commit comments