mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: add more inspect subclassing tests
So far we do not test all data types for subclasses and this extends the existing tests for WeakSet, WeakMap and BigInt64Array. PR-URL: https://github.com/nodejs/node/pull/25192 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
73f3a1c4e6
commit
e182ca9bdc
1 file changed
+4
-1
@@ -1662,7 +1662,10 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'");
|
||||
|
||||
// Verify that subclasses with and without prototype produce nice results.
|
||||
[
|
||||
[RegExp, ['foobar', 'g'], '/foobar/g']
|
||||
[RegExp, ['foobar', 'g'], '/foobar/g'],
|
||||
[WeakSet, [[{}]], '{ <items unknown> }'],
|
||||
[WeakMap, [[[{}, {}]]], '{ <items unknown> }'],
|
||||
[BigInt64Array, [10], '[ 0n, 0n, 0n, 0n, 0n, 0n, 0n, 0n, 0n, 0n ]']
|
||||
].forEach(([base, input, rawExpected]) => {
|
||||
class Foo extends base {}
|
||||
const value = new Foo(...input);
|
||||
|
||||
Reference in new issue
Block a user