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: nodejs#36622 (review)

PR-URL: nodejs#36625
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
Trott committed Dec 27, 2020
1 parent 73b8909 commit 75afb6c
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 75afb6c

Please sign in to comment.