From 75afb6c7a6a7143d8e9f6f8e914f78a4814b2827 Mon Sep 17 00:00:00 2001
From: Rich Trott <rtrott@gmail.com>
Date: Thu, 24 Dec 2020 16:14:43 -0800
Subject: [PATCH] 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>
---
 test/parallel/test-util-inspect.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index b14cab3d13358a..ad8da0a7a47e9d 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -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),