@@ -48,27 +48,22 @@ describe('Dynamic Instrumentation', function () {
4848 assert . strictEqual ( messages . shift ( ) , '[]' )
4949 assert . strictEqual ( messages . shift ( ) , '[ [Object], 2, 3, ... 2 more items ]' )
5050 assert . strictEqual ( messages . shift ( ) , '{}' )
51+ assert . strictEqual ( messages . shift ( ) , '{ a: 1, b: 2, c: 3, d: 4, e: 5 }' )
5152 const obj = messages . shift ( )
52- let expectedObjectShape = '{ ' +
53- 'foo: [Object], ' +
54- 'bar: true, ' +
55- 'baz: [Getter], ' +
56- ( NODE_MAJOR >= 24
57- ? 'Symbol(nodejs.util.inspect.custom): [Function: [nodejs.util.inspect.custom]] '
58- : '[Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]] ' ) +
53+ const expectedObjectShape = '{ ' +
54+ 'foo: [Object], bar: true, baz: [Getter], qux: 42, quux: false, ... 1 more property ' +
5955 '}'
6056 assert . strictEqual ( obj , expectedObjectShape )
61- if ( NODE_MAJOR >= 26 ) {
62- // A proxy should be stringified to the wrapped object plus the proxy type in newer Node.js versions
63- expectedObjectShape = `Proxy(${ expectedObjectShape } )`
64- }
65- assert . strictEqual ( messages . shift ( ) , expectedObjectShape )
57+ assert . strictEqual ( messages . shift ( ) , '[Proxy]' )
58+ assert . strictEqual ( messages . shift ( ) , '{ a: 1, b: 2, c: 3, d: 4, e: 5, ... 1 more property }' )
59+ assert . strictEqual ( messages . shift ( ) , '[Value omitted: inspection may execute user code]' )
6660 assert . strictEqual ( messages . shift ( ) , '<ref *1> { circular: [Circular *1] }' )
61+ assert . strictEqual (
62+ messages . shift ( ) ,
63+ '<ref *1> { circular: [Circular *1], a: 1, b: 2, c: 3, d: 4, ... 1 more property }'
64+ )
6765 assert . strictEqual ( messages . shift ( ) , '[class CustomClass]' )
68- // Notice execution of `Symbol.toStringTag` getter (`foo`). There's nothing we can do about it when using
69- // `util.inspect`, but it has not been considered a big side-effects issue, as anyone implementing this
70- // function is doing so with the explicit intent of modifying the string representation of instances.
71- assert . strictEqual ( messages . shift ( ) , 'CustomClass [foo] { b: 2, c: 3 }' )
66+ assert . strictEqual ( messages . shift ( ) , '{ b: 2, c: 3, d: 4, e: 5, f: 6, ... 1 more property }' )
7267 if ( NODE_MAJOR >= 24 ) {
7368 assert . strictEqual ( messages . shift ( ) , 'Promise { 42 }' )
7469 } else {
@@ -83,18 +78,8 @@ describe('Dynamic Instrumentation', function () {
8378 }
8479 assert . strictEqual ( messages . shift ( ) , '[Function: arrowFn]' )
8580 assert . strictEqual ( messages . shift ( ) , '[Function: fn]' )
86- assert . strictEqual (
87- messages . shift ( ) ,
88- NODE_MAJOR > 18
89- ? 'Set(5) { 1, 2, 3, ... 2 more items }'
90- : 'Set(5) { 1, 2, 3, 4, 5 }'
91- )
92- assert . strictEqual (
93- messages . shift ( ) ,
94- NODE_MAJOR > 18
95- ? 'Map(5) { 1 => 2, 3 => 4, 5 => 6, ... 2 more items }'
96- : 'Map(5) { 1 => 2, 3 => 4, 5 => 6, 7 => 8, 9 => 10 }'
97- )
81+ assert . strictEqual ( messages . shift ( ) , 'Set(5) { 1, 2, 3, ... 2 more items }' )
82+ assert . strictEqual ( messages . shift ( ) , 'Map(5) { 1 => 2, 3 => 4, 5 => 6, ... 2 more items }' )
9883 assert . strictEqual ( messages . shift ( ) , 'WeakSet { <items unknown> }' )
9984 assert . strictEqual ( messages . shift ( ) , 'WeakMap { <items unknown> }' )
10085 assert . strictEqual ( messages . shift ( ) , 'Buffer(6) [Uint8Array] [ 102, 111, 111, ... 3 more items ]' )
@@ -138,12 +123,20 @@ describe('Dynamic Instrumentation', function () {
138123 { str : ';' } ,
139124 { dsl : 'emptyObj' , json : { ref : 'emptyObj' } } ,
140125 { str : ';' } ,
126+ { dsl : 'maxObj' , json : { ref : 'maxObj' } } ,
127+ { str : ';' } ,
141128 { dsl : 'obj' , json : { ref : 'obj' } } ,
142129 { str : ';' } ,
143130 { dsl : 'proxy' , json : { ref : 'proxy' } } ,
144131 { str : ';' } ,
132+ { dsl : 'objectWithProxyPrototype' , json : { ref : 'objectWithProxyPrototype' } } ,
133+ { str : ';' } ,
134+ { dsl : 'sideEffectfulObject' , json : { ref : 'sideEffectfulObject' } } ,
135+ { str : ';' } ,
145136 { dsl : 'circular' , json : { ref : 'circular' } } ,
146137 { str : ';' } ,
138+ { dsl : 'wideCircular' , json : { ref : 'wideCircular' } } ,
139+ { str : ';' } ,
147140 { dsl : 'CustomClass' , json : { ref : 'CustomClass' } } ,
148141 { str : ';' } ,
149142 { dsl : 'ins' , json : { ref : 'ins' } } ,
0 commit comments