test: improve coverage for util.inspect() with classes

Refs: https://github.com/nodejs/node/pull/36622#pullrequestreview-558721102

PR-URL: https://github.com/nodejs/node/pull/36625
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Rich Trott authored and Michaël Zasso committed 2021-05-01 09:44:49 +02:00
1 parent e82a2e8ad5
commit 581a95f0ea
1 file changed
+5
+5
View File
@@ -2011,6 +2011,11 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'");
rest[rest.length - 1] = rest[rest.length - 1].slice(0, -1);
rest.length = 1;
}
Object.setPrototypeOf(clazz, Map.prototype);
assert.strictEqual(
util.inspect(clazz),
['[class', name, '[Map]', ...rest].join(' ') + ']'
);
Object.setPrototypeOf(clazz, null);
assert.strictEqual(
util.inspect(clazz),