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 danielleadams committed Jan 12, 2021
1 parent 1f3bc5e commit 34d1d79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
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 34d1d79

Please sign in to comment.