Navigation Menu

Skip to content

Commit

Permalink
test: improve coverage for util.inspect() with classes
Browse files Browse the repository at this point in the history
Refs: #36622 (review)

PR-URL: #36625
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
Trott authored and targos committed May 1, 2021
1 parent e82a2e8 commit 581a95f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-util-inspect.js
Expand Up @@ -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),
Expand Down

0 comments on commit 581a95f

Please sign in to comment.