test: add util inspect null getter test
PR-URL: https://github.com/nodejs/node/pull/27884 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
This commit is contained in:
parent
2c640bfa46
commit
1dbf2765bc
@ -339,6 +339,15 @@ assert.strictEqual(
|
|||||||
const value = {};
|
const value = {};
|
||||||
value.a = value;
|
value.a = value;
|
||||||
assert.strictEqual(util.inspect(value), '<ref *1> { a: [Circular *1] }');
|
assert.strictEqual(util.inspect(value), '<ref *1> { a: [Circular *1] }');
|
||||||
|
const getterFn = {
|
||||||
|
get one() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
assert.strictEqual(
|
||||||
|
util.inspect(getterFn, { getters: true }),
|
||||||
|
'{ one: [Getter: null] }'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Array with dynamic properties.
|
// Array with dynamic properties.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user