@@ -21,7 +21,25 @@ test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspec
21
21
22
22
t . equal ( inspect ( [ obj , [ ] ] ) , '[ ' + ( utilInspect . custom ? 'symbol' : 'string' ) + ', [] ]' ) ;
23
23
t . equal ( inspect ( [ obj , [ ] ] , { customInspect : true } ) , '[ ' + ( utilInspect . custom ? 'symbol' : 'string' ) + ', [] ]' ) ;
24
- t . equal ( inspect ( [ obj , [ ] ] , { customInspect : false } ) , '[ { inspect: [Function: stringInspect] }, [] ]' ) ;
24
+ t . equal (
25
+ inspect ( [ obj , [ ] ] , { customInspect : false } ) ,
26
+ '[ { inspect: [Function: stringInspect]' + ( utilInspect . custom ? ', [' + inspect ( utilInspect . custom ) + ']: [Function: custom]' : '' ) + ' }, [] ]'
27
+ ) ;
28
+ } ) ;
29
+
30
+ test ( 'symbols' , { skip : ! hasSymbols } , function ( t ) {
31
+ t . plan ( 2 ) ;
32
+
33
+ var obj = { a : 1 } ;
34
+ obj [ Symbol ( 'test' ) ] = 2 ;
35
+ obj [ Symbol . iterator ] = 3 ;
36
+ Object . defineProperty ( obj , Symbol ( 'non-enum' ) , {
37
+ enumerable : false ,
38
+ value : 4
39
+ } ) ;
40
+
41
+ t . equal ( inspect ( obj ) , '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }' , 'object with symbols' ) ;
42
+ t . equal ( inspect ( [ obj , [ ] ] ) , '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]' , 'object with symbols' ) ;
25
43
} ) ;
26
44
27
45
test ( 'maxStringLength' , function ( t ) {
0 commit comments