Skip to content

Commit 630cc3a

Browse files
pinguinjkeketargos
authored andcommitted
test: cover util.inspect on boxed primitive with colors
PR-URL: #27897 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 0fe16ed commit 630cc3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/parallel/test-util-inspect.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,10 @@ assert.strictEqual(
902902

903903
// Test boxed primitives output the correct values.
904904
assert.strictEqual(util.inspect(new String('test')), "[String: 'test']");
905+
assert.strictEqual(
906+
util.inspect(new String('test'), { colors: true }),
907+
"\u001b[32m[String: 'test']\u001b[39m"
908+
);
905909
assert.strictEqual(
906910
util.inspect(Object(Symbol('test'))),
907911
'[Symbol: Symbol(test)]'

0 commit comments

Comments
 (0)