From bc6511a2433cdb9e3c2480871db266be38353492 Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Tue, 4 Apr 2023 01:43:32 +0300 Subject: [PATCH] test_runner: color errors only when colors are available PR-URL: https://github.com/nodejs/node/pull/47394 Fixes: https://github.com/nodejs/node/issues/47393 Reviewed-By: Colin Ihrig Reviewed-By: Yagiz Nizipli Reviewed-By: Rich Trott --- lib/internal/test_runner/reporter/spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/test_runner/reporter/spec.js b/lib/internal/test_runner/reporter/spec.js index 69681610e2c46a..ecc20bb866a784 100644 --- a/lib/internal/test_runner/reporter/spec.js +++ b/lib/internal/test_runner/reporter/spec.js @@ -14,10 +14,10 @@ const { const assert = require('assert'); const Transform = require('internal/streams/transform'); const { inspectWithNoCustomRetry } = require('internal/errors'); -const { green, blue, red, white, gray } = require('internal/util/colors'); +const { green, blue, red, white, gray, hasColors } = require('internal/util/colors'); const { getCoverageReport } = require('internal/test_runner/utils'); -const inspectOptions = { __proto__: null, colors: true, breakLength: Infinity }; +const inspectOptions = { __proto__: null, colors: hasColors, breakLength: Infinity }; const colors = { '__proto__': null,