diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index dba40c0a0e3c42..59e67810c2c41f 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -34,6 +34,12 @@ const { writeFileSync, unlinkSync } = require('fs'); const { inspect } = require('util'); const a = assert; +// 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'; + const start = 'Input A expected to strictly deep-equal input B:'; const actExp = '+ expected - actual';