@@ -51,7 +51,9 @@ describe('Dynamic Instrumentation', function () {
51
51
'foo: [Object], ' +
52
52
'bar: true, ' +
53
53
'baz: [Getter], ' +
54
- '[Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]] ' +
54
+ ( NODE_MAJOR >= 24
55
+ ? 'Symbol(nodejs.util.inspect.custom): [Function: [nodejs.util.inspect.custom]] '
56
+ : '[Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]] ' ) +
55
57
'}'
56
58
)
57
59
assert . strictEqual ( messages . shift ( ) , obj ) // a proxy should just be stringified to the wrapped object
@@ -61,14 +63,18 @@ describe('Dynamic Instrumentation', function () {
61
63
// `util.inspect`, but it has not been considered a big side-effects issue, as anyone implementing this
62
64
// function is doing so with the explicit intent of modifying the string representation of instances.
63
65
assert . strictEqual ( messages . shift ( ) , 'CustomClass [foo] { b: 2, c: 3 }' )
64
- // Full promise example string (line breaks added for readability):
65
- // Promise {
66
- // 42,
67
- // [Symbol(async_id_symbol)]: 205,
68
- // [Symbol(trigger_async_id_symbol)]: 204,
69
- // [Symbol(kResourceStore)]: {}
70
- // }
71
- assert . ok ( messages . shift ( ) . startsWith ( 'Promise { 42, ' ) )
66
+ if ( NODE_MAJOR >= 24 ) {
67
+ assert . strictEqual ( messages . shift ( ) , 'Promise { 42 }' )
68
+ } else {
69
+ // Full promise example string (line breaks added for readability):
70
+ // Promise {
71
+ // 42,
72
+ // [Symbol(async_id_symbol)]: 205,
73
+ // [Symbol(trigger_async_id_symbol)]: 204,
74
+ // [Symbol(kResourceStore)]: {}
75
+ // }
76
+ assert . ok ( messages . shift ( ) . startsWith ( 'Promise { 42, ' ) )
77
+ }
72
78
assert . strictEqual ( messages . shift ( ) , '[Function: arrowFn]' )
73
79
assert . strictEqual ( messages . shift ( ) , '[Function: fn]' )
74
80
assert . strictEqual (
0 commit comments