summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-23 17:42:27 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-12-27 22:30:32 +0100
commitc9d08c7af26c24a9d0f41578cabdba1ebe13c7ac (patch)
treeab740280ee265738215ec09e363d62a09925e529 /test
parentbd13afb04a551b762d45d041d30790d4ac6d7f4a (diff)
downloadandroid-node-v8-c9d08c7af26c24a9d0f41578cabdba1ebe13c7ac.tar.gz
android-node-v8-c9d08c7af26c24a9d0f41578cabdba1ebe13c7ac.tar.bz2
android-node-v8-c9d08c7af26c24a9d0f41578cabdba1ebe13c7ac.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-util-inspect.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index 9ee0272089..66887a10f4 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -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);