Skip to content

Commit 1dbf276

Browse files
mihan007Trott
authored andcommitted
test: add util inspect null getter test
PR-URL: #27884 Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]>
1 parent 2c640bf commit 1dbf276

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/parallel/test-util-inspect.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ assert.strictEqual(
339339
const value = {};
340340
value.a = value;
341341
assert.strictEqual(util.inspect(value), '<ref *1> { a: [Circular *1] }');
342+
const getterFn = {
343+
get one() {
344+
return null;
345+
}
346+
};
347+
assert.strictEqual(
348+
util.inspect(getterFn, { getters: true }),
349+
'{ one: [Getter: null] }'
350+
);
342351
}
343352

344353
// Array with dynamic properties.

0 commit comments

Comments
 (0)