diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index 4fa091ef2af..538f4bef49d 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -7,6 +7,12 @@ const { AssertionError } = assert; const defaultMsgStart = 'Input A expected to strictly deep-equal input B:\n' + '+ expected - actual'; +// Disable colored output to prevent color codes from breaking assertion +// message comparisons. This should only be an issue when process.stdout +// is a TTY. +if (process.stdout.isTTY) + process.env.NODE_DISABLE_COLORS = '1'; + // Template tag function turning an error message into a RegExp // for assert.throws() function re(literals, ...values) {