From b17e2178366921eccdab69c81ef0b20f0208e4a8 Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Thu, 1 Feb 2024 19:26:01 +1100 Subject: [PATCH 01/10] console: colorize console error and warn prints console error in red and warn in yellow --- lib/internal/console/constructor.js | 22 +++++++++++++--- lib/internal/util/colors.js | 39 ++++++++++++++++------------- test/parallel/test-repl.js | 2 +- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 454652e3632472..8f432a843691c5 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -7,6 +7,7 @@ const { ArrayFrom, ArrayIsArray, ArrayPrototypeForEach, + ArrayPrototypeEvery, ArrayPrototypePush, ArrayPrototypeUnshift, Boolean, @@ -273,7 +274,7 @@ ObjectDefineProperties(Console.prototype, { [kWriteToConsole]: { __proto__: null, ...consolePropAttributes, - value: function(streamSymbol, string) { + value: function(streamSymbol, string, color) { const ignoreErrors = this._ignoreErrors; const groupIndent = this[kGroupIndent]; @@ -288,6 +289,11 @@ ObjectDefineProperties(Console.prototype, { } string = groupIndent + string; } + + if (color) { + string = `${color}${string}${lazyUtilColors().clear}`; + } + string += '\n'; if (ignoreErrors === false) return stream.write(string); @@ -381,9 +387,14 @@ const consoleMethods = { warn(...args) { - this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args)); + const color = shouldColorise(args, this._stdout.isTTY) && lazyUtilColors().yellow; + this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); }, + error(...args) { + const color = shouldColorise(args, this._stdout.isTTY) && lazyUtilColors().red; + this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); + }, dir(object, options) { this[kWriteToConsole](kUseStdout, inspect(object, { @@ -681,6 +692,12 @@ const iterKey = '(iteration index)'; const isArray = (v) => ArrayIsArray(v) || isTypedArray(v) || isBuffer(v); +// Return true if all args are type string and isTTY +const shouldColorise = (args, isTTY) => { + return isTTY && lazyUtilColors().hasColors && + ArrayPrototypeEvery(args, (arg) => typeof arg === 'string'); +}; + function noop() {} for (const method of ReflectOwnKeys(consoleMethods)) @@ -689,7 +706,6 @@ for (const method of ReflectOwnKeys(consoleMethods)) Console.prototype.debug = Console.prototype.log; Console.prototype.info = Console.prototype.log; Console.prototype.dirxml = Console.prototype.log; -Console.prototype.error = Console.prototype.warn; Console.prototype.groupCollapsed = Console.prototype.group; function initializeGlobalConsole(globalConsole) { diff --git a/lib/internal/util/colors.js b/lib/internal/util/colors.js index 31e3e9b22585c5..42204864748540 100644 --- a/lib/internal/util/colors.js +++ b/lib/internal/util/colors.js @@ -1,18 +1,27 @@ 'use strict'; +const { + ArrayPrototypeForEach, + ObjectKeys, +} = primordials; + let internalTTy; function lazyInternalTTY() { internalTTy ??= require('internal/tty'); return internalTTy; } +const colorsMap = { + blue: '\u001b[34m', + green: '\u001b[32m', + white: '\u001b[39m', + yellow: '\u001b[33m', + red: '\u001b[31m', + gray: '\u001b[90m', + clear: '\u001b[0m', +}; + module.exports = { - blue: '', - green: '', - white: '', - red: '', - gray: '', - clear: '', hasColors: false, shouldColorize(stream) { if (process.env.FORCE_COLOR !== undefined) { @@ -23,17 +32,13 @@ module.exports = { stream.getColorDepth() > 2 : true); }, refresh() { - if (process.stderr.isTTY) { - const hasColors = module.exports.shouldColorize(process.stderr); - module.exports.blue = hasColors ? '\u001b[34m' : ''; - module.exports.green = hasColors ? '\u001b[32m' : ''; - module.exports.white = hasColors ? '\u001b[39m' : ''; - module.exports.yellow = hasColors ? '\u001b[33m' : ''; - module.exports.red = hasColors ? '\u001b[31m' : ''; - module.exports.gray = hasColors ? '\u001b[90m' : ''; - module.exports.clear = hasColors ? '\u001bc' : ''; - module.exports.hasColors = hasColors; - } + const isTTY = process.stderr.isTTY; + const hasColors = isTTY && module.exports.shouldColorize(process.stderr); + ArrayPrototypeForEach(ObjectKeys(colorsMap), (key) => { + module.exports[key] = hasColors ? colorsMap[key] : ''; + }); + + module.exports.hasColors = hasColors; }, }; diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 98a0bc79c64d91..0d467e2b35dbdc 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -770,6 +770,7 @@ const errorTests = [ 'Object [console] {', ' log: [Function: log],', ' warn: [Function: warn],', + ' error: [Function: error],', ' dir: [Function: dir],', ' time: [Function: time],', ' timeEnd: [Function: timeEnd],', @@ -785,7 +786,6 @@ const errorTests = [ / {2}debug: \[Function: (debug|log)],/, / {2}info: \[Function: (info|log)],/, / {2}dirxml: \[Function: (dirxml|log)],/, - / {2}error: \[Function: (error|warn)],/, / {2}groupCollapsed: \[Function: (groupCollapsed|group)],/, / {2}Console: \[Function: Console],?/, ...process.features.inspector ? [ From 2a6c353983706a1a07b230d02c4863f2f59c088d Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Thu, 4 Apr 2024 17:57:31 +0530 Subject: [PATCH 02/10] optimized negative cases --- lib/internal/console/constructor.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 8f432a843691c5..a8a7f74ea4222a 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -387,12 +387,12 @@ const consoleMethods = { warn(...args) { - const color = shouldColorise(args, this._stdout.isTTY) && lazyUtilColors().yellow; + const color = shouldColorize(args) ? lazyUtilColors().yellow : ''; this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); }, error(...args) { - const color = shouldColorise(args, this._stdout.isTTY) && lazyUtilColors().red; + const color = shouldColorize(args) ? lazyUtilColors().red : ''; this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); }, @@ -693,9 +693,8 @@ const iterKey = '(iteration index)'; const isArray = (v) => ArrayIsArray(v) || isTypedArray(v) || isBuffer(v); // Return true if all args are type string and isTTY -const shouldColorise = (args, isTTY) => { - return isTTY && lazyUtilColors().hasColors && - ArrayPrototypeEvery(args, (arg) => typeof arg === 'string'); +const shouldColorize = (args) => { + return ArrayPrototypeEvery(args, (arg) => typeof arg === 'string'); }; function noop() {} From 9250885eec4e0207a1efe3bf1a7847bd20dddac0 Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Sat, 6 Apr 2024 16:14:59 +0530 Subject: [PATCH 03/10] use util.styleText instead of color --- lib/internal/console/constructor.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index a8a7f74ea4222a..9f2bd5f40bca33 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -8,6 +8,7 @@ const { ArrayIsArray, ArrayPrototypeForEach, ArrayPrototypeEvery, + ArrayPrototypeMap, ArrayPrototypePush, ArrayPrototypeUnshift, Boolean, @@ -68,6 +69,7 @@ const { CHAR_LOWERCASE_N: kTraceInstant, CHAR_UPPERCASE_C: kTraceCount, } = require('internal/constants'); +const { styleText } = require('util'); const kCounts = Symbol('counts'); const kTraceConsoleCategory = 'node,node.console'; @@ -274,7 +276,7 @@ ObjectDefineProperties(Console.prototype, { [kWriteToConsole]: { __proto__: null, ...consolePropAttributes, - value: function(streamSymbol, string, color) { + value: function(streamSymbol, string) { const ignoreErrors = this._ignoreErrors; const groupIndent = this[kGroupIndent]; @@ -289,11 +291,6 @@ ObjectDefineProperties(Console.prototype, { } string = groupIndent + string; } - - if (color) { - string = `${color}${string}${lazyUtilColors().clear}`; - } - string += '\n'; if (ignoreErrors === false) return stream.write(string); @@ -387,13 +384,13 @@ const consoleMethods = { warn(...args) { - const color = shouldColorize(args) ? lazyUtilColors().yellow : ''; - this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); + args = colorizeText(args, 'yellow'); + this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args)); }, error(...args) { - const color = shouldColorize(args) ? lazyUtilColors().red : ''; - this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); + args = colorizeText(args, 'red'); + this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args)); }, dir(object, options) { @@ -692,9 +689,11 @@ const iterKey = '(iteration index)'; const isArray = (v) => ArrayIsArray(v) || isTypedArray(v) || isBuffer(v); -// Return true if all args are type string and isTTY -const shouldColorize = (args) => { - return ArrayPrototypeEvery(args, (arg) => typeof arg === 'string'); +// Return styled text if all arguments are strings +const colorizeText = (args, color) => { + if(!ArrayPrototypeEvery(args, (arg) => typeof arg === 'string')) return args; + + return ArrayPrototypeMap(args, (arg) => styleText(color, arg)); }; function noop() {} From 5d23fbea75c1f7f3e9fa4cd207eab2f13add02db Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Sat, 6 Apr 2024 16:29:48 +0530 Subject: [PATCH 04/10] fix lint warnings --- lib/internal/console/constructor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 9f2bd5f40bca33..119a6566825005 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -691,7 +691,7 @@ const isArray = (v) => ArrayIsArray(v) || isTypedArray(v) || isBuffer(v); // Return styled text if all arguments are strings const colorizeText = (args, color) => { - if(!ArrayPrototypeEvery(args, (arg) => typeof arg === 'string')) return args; + if (!ArrayPrototypeEvery(args, (arg) => typeof arg === 'string')) return args; return ArrayPrototypeMap(args, (arg) => styleText(color, arg)); }; From 377510304cc9a59988fc74cd914194f0c8c7a700 Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Sat, 6 Apr 2024 16:35:57 +0530 Subject: [PATCH 05/10] change every to some --- lib/internal/console/constructor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 119a6566825005..34207ef2611c4c 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -7,9 +7,9 @@ const { ArrayFrom, ArrayIsArray, ArrayPrototypeForEach, - ArrayPrototypeEvery, ArrayPrototypeMap, ArrayPrototypePush, + ArrayPrototypeSome, ArrayPrototypeUnshift, Boolean, ErrorCaptureStackTrace, @@ -689,9 +689,10 @@ const iterKey = '(iteration index)'; const isArray = (v) => ArrayIsArray(v) || isTypedArray(v) || isBuffer(v); +// TODO: remove string type check once the styleText supports objects // Return styled text if all arguments are strings const colorizeText = (args, color) => { - if (!ArrayPrototypeEvery(args, (arg) => typeof arg === 'string')) return args; + if (ArrayPrototypeSome(args, (arg) => typeof arg !== 'string')) return args; return ArrayPrototypeMap(args, (arg) => styleText(color, arg)); }; From 2bdec1e37242631cd95e204e1b43046e532a2ac6 Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Sun, 7 Apr 2024 12:07:01 +0530 Subject: [PATCH 06/10] added has color checks --- lib/internal/console/constructor.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 34207ef2611c4c..171e83f0fc3509 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -7,7 +7,6 @@ const { ArrayFrom, ArrayIsArray, ArrayPrototypeForEach, - ArrayPrototypeMap, ArrayPrototypePush, ArrayPrototypeSome, ArrayPrototypeUnshift, @@ -276,7 +275,7 @@ ObjectDefineProperties(Console.prototype, { [kWriteToConsole]: { __proto__: null, ...consolePropAttributes, - value: function(streamSymbol, string) { + value: function(streamSymbol, string, color = '') { const ignoreErrors = this._ignoreErrors; const groupIndent = this[kGroupIndent]; @@ -291,6 +290,11 @@ ObjectDefineProperties(Console.prototype, { } string = groupIndent + string; } + + if (color) { + string = styleText(color, string); + } + string += '\n'; if (ignoreErrors === false) return stream.write(string); @@ -381,16 +385,14 @@ const consoleMethods = { log(...args) { this[kWriteToConsole](kUseStdout, this[kFormatForStdout](args)); }, - - warn(...args) { - args = colorizeText(args, 'yellow'); - this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args)); + const color = (shouldColorize(args) && 'yellow') || ''; + this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); }, error(...args) { - args = colorizeText(args, 'red'); - this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args)); + const color = (shouldColorize(args) && 'red') || ''; + this[kWriteToConsole](kUseStderr, this[kFormatForStderr](args), color); }, dir(object, options) { @@ -690,11 +692,9 @@ const iterKey = '(iteration index)'; const isArray = (v) => ArrayIsArray(v) || isTypedArray(v) || isBuffer(v); // TODO: remove string type check once the styleText supports objects -// Return styled text if all arguments are strings -const colorizeText = (args, color) => { - if (ArrayPrototypeSome(args, (arg) => typeof arg !== 'string')) return args; - - return ArrayPrototypeMap(args, (arg) => styleText(color, arg)); +// Return true if all args are type string +const shouldColorize = (args) => { + return lazyUtilColors().hasColors && !ArrayPrototypeSome(args, (arg) => typeof arg !== 'string'); }; function noop() {} From cbddf0e312c908dc20922de084fafe05fe37e0bd Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Mon, 8 Apr 2024 16:13:20 +0530 Subject: [PATCH 07/10] fix unit tests --- test/pseudo-tty/test-tty-color-support-warning-2.out | 2 +- test/pseudo-tty/test-tty-color-support-warning.out | 2 +- test/pseudo-tty/test-tty-color-support.out | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pseudo-tty/test-tty-color-support-warning-2.out b/test/pseudo-tty/test-tty-color-support-warning-2.out index 37b470a5f108f9..3f273e33ec1918 100644 --- a/test/pseudo-tty/test-tty-color-support-warning-2.out +++ b/test/pseudo-tty/test-tty-color-support-warning-2.out @@ -1,3 +1,3 @@ -(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set. +[31m(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set. (Use `* --trace-warnings ...` to show where the warning was created) diff --git a/test/pseudo-tty/test-tty-color-support-warning.out b/test/pseudo-tty/test-tty-color-support-warning.out index b25d2e42cf7244..9d12231600851a 100644 --- a/test/pseudo-tty/test-tty-color-support-warning.out +++ b/test/pseudo-tty/test-tty-color-support-warning.out @@ -1,3 +1,3 @@ -(node:*) Warning: The 'NODE_DISABLE_COLORS' and 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +[31m(node:*) Warning: The 'NODE_DISABLE_COLORS' and 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. (Use `* --trace-warnings ...` to show where the warning was created) diff --git a/test/pseudo-tty/test-tty-color-support.out b/test/pseudo-tty/test-tty-color-support.out index df5831c555be19..7042e54ce7e745 100644 --- a/test/pseudo-tty/test-tty-color-support.out +++ b/test/pseudo-tty/test-tty-color-support.out @@ -1,2 +1,2 @@ -(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +[31m(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. (Use `* --trace-warnings ...` to show where the warning was created) From 27111bd6f03c94995dc6e153c5a348b1f32b233d Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Mon, 8 Apr 2024 16:15:18 +0530 Subject: [PATCH 08/10] fix unit tests --- test/pseudo-tty/test-tty-color-support-warning-2.out | 2 +- test/pseudo-tty/test-tty-color-support-warning.out | 2 +- test/pseudo-tty/test-tty-color-support.out | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pseudo-tty/test-tty-color-support-warning-2.out b/test/pseudo-tty/test-tty-color-support-warning-2.out index 3f273e33ec1918..9a867b83c4cedb 100644 --- a/test/pseudo-tty/test-tty-color-support-warning-2.out +++ b/test/pseudo-tty/test-tty-color-support-warning-2.out @@ -1,3 +1,3 @@ [31m(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set. -(Use `* --trace-warnings ...` to show where the warning was created) +(Use `* --trace-warnings ...` to show where the warning was created)[39m diff --git a/test/pseudo-tty/test-tty-color-support-warning.out b/test/pseudo-tty/test-tty-color-support-warning.out index 9d12231600851a..e5d4361f56e00f 100644 --- a/test/pseudo-tty/test-tty-color-support-warning.out +++ b/test/pseudo-tty/test-tty-color-support-warning.out @@ -1,3 +1,3 @@ [31m(node:*) Warning: The 'NODE_DISABLE_COLORS' and 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. -(Use `* --trace-warnings ...` to show where the warning was created) +(Use `* --trace-warnings ...` to show where the warning was created)[39m diff --git a/test/pseudo-tty/test-tty-color-support.out b/test/pseudo-tty/test-tty-color-support.out index 7042e54ce7e745..8ed28f4b22f1e4 100644 --- a/test/pseudo-tty/test-tty-color-support.out +++ b/test/pseudo-tty/test-tty-color-support.out @@ -1,2 +1,2 @@ [31m(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. -(Use `* --trace-warnings ...` to show where the warning was created) +(Use `* --trace-warnings ...` to show where the warning was created)[39m From 82bdc0144058c7062db9e79c920b1c18f3a296d1 Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Mon, 8 Apr 2024 22:36:19 +0530 Subject: [PATCH 09/10] remove colors refactoring --- lib/internal/util/colors.js | 39 ++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/lib/internal/util/colors.js b/lib/internal/util/colors.js index 42204864748540..31e3e9b22585c5 100644 --- a/lib/internal/util/colors.js +++ b/lib/internal/util/colors.js @@ -1,27 +1,18 @@ 'use strict'; -const { - ArrayPrototypeForEach, - ObjectKeys, -} = primordials; - let internalTTy; function lazyInternalTTY() { internalTTy ??= require('internal/tty'); return internalTTy; } -const colorsMap = { - blue: '\u001b[34m', - green: '\u001b[32m', - white: '\u001b[39m', - yellow: '\u001b[33m', - red: '\u001b[31m', - gray: '\u001b[90m', - clear: '\u001b[0m', -}; - module.exports = { + blue: '', + green: '', + white: '', + red: '', + gray: '', + clear: '', hasColors: false, shouldColorize(stream) { if (process.env.FORCE_COLOR !== undefined) { @@ -32,13 +23,17 @@ module.exports = { stream.getColorDepth() > 2 : true); }, refresh() { - const isTTY = process.stderr.isTTY; - const hasColors = isTTY && module.exports.shouldColorize(process.stderr); - ArrayPrototypeForEach(ObjectKeys(colorsMap), (key) => { - module.exports[key] = hasColors ? colorsMap[key] : ''; - }); - - module.exports.hasColors = hasColors; + if (process.stderr.isTTY) { + const hasColors = module.exports.shouldColorize(process.stderr); + module.exports.blue = hasColors ? '\u001b[34m' : ''; + module.exports.green = hasColors ? '\u001b[32m' : ''; + module.exports.white = hasColors ? '\u001b[39m' : ''; + module.exports.yellow = hasColors ? '\u001b[33m' : ''; + module.exports.red = hasColors ? '\u001b[31m' : ''; + module.exports.gray = hasColors ? '\u001b[90m' : ''; + module.exports.clear = hasColors ? '\u001bc' : ''; + module.exports.hasColors = hasColors; + } }, }; From 6d453d239b39531e869676b2e86790a819b5476f Mon Sep 17 00:00:00 2001 From: Jithil P Ponnan Date: Mon, 15 Apr 2024 18:24:44 +0530 Subject: [PATCH 10/10] test tty changes --- test/pseudo-tty/test-tty-color-support-warning-2.out | 4 ++-- test/pseudo-tty/test-tty-color-support-warning.out | 4 ++-- test/pseudo-tty/test-tty-color-support.out | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/pseudo-tty/test-tty-color-support-warning-2.out b/test/pseudo-tty/test-tty-color-support-warning-2.out index 9a867b83c4cedb..61a1baa0b54fb6 100644 --- a/test/pseudo-tty/test-tty-color-support-warning-2.out +++ b/test/pseudo-tty/test-tty-color-support-warning-2.out @@ -1,3 +1,3 @@ -[31m(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set. -(Use `* --trace-warnings ...` to show where the warning was created)[39m +*(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `* --trace-warnings ...` to show where the warning was created)* diff --git a/test/pseudo-tty/test-tty-color-support-warning.out b/test/pseudo-tty/test-tty-color-support-warning.out index e5d4361f56e00f..35ed65c96d29ad 100644 --- a/test/pseudo-tty/test-tty-color-support-warning.out +++ b/test/pseudo-tty/test-tty-color-support-warning.out @@ -1,3 +1,3 @@ -[31m(node:*) Warning: The 'NODE_DISABLE_COLORS' and 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. -(Use `* --trace-warnings ...` to show where the warning was created)[39m +*(node:*) Warning: The 'NODE_DISABLE_COLORS' and 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `* --trace-warnings ...` to show where the warning was created)* diff --git a/test/pseudo-tty/test-tty-color-support.out b/test/pseudo-tty/test-tty-color-support.out index 8ed28f4b22f1e4..55b3986f73b2f0 100644 --- a/test/pseudo-tty/test-tty-color-support.out +++ b/test/pseudo-tty/test-tty-color-support.out @@ -1,2 +1,2 @@ -[31m(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. -(Use `* --trace-warnings ...` to show where the warning was created)[39m +*(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `* --trace-warnings ...` to show where the warning was created)*