test: cover util.inspect on boxed primitive with colors

PR-URL: https://github.com/nodejs/node/pull/27897
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Alexander Avakov 2019-05-26 15:54:20 +03:00 committed by Ujjwal Sharma
parent 28ec14fded
commit c31ac419a9
No known key found for this signature in database
GPG Key ID: 1FD3B47B83F46621

View File

@ -902,6 +902,10 @@ assert.strictEqual(
// Test boxed primitives output the correct values.
assert.strictEqual(util.inspect(new String('test')), "[String: 'test']");
assert.strictEqual(
util.inspect(new String('test'), { colors: true }),
"\u001b[32m[String: 'test']\u001b[39m"
);
assert.strictEqual(
util.inspect(Object(Symbol('test'))),
'[Symbol: Symbol(test)]'