test: disable colors in test-assert-checktag.js
When test/parallel/test-assert-checktag.js is run with a TTY as stdout, color codes in assertion messages cause the test to fail. This commit disables colors when stdout is a TTY. PR-URL: https://github.com/nodejs/node/pull/20695 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
7597d45bee
commit
ee2a7703e7
@ -2,6 +2,12 @@
|
||||
require('../common');
|
||||
const assert = require('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';
|
||||
|
||||
// Turn off no-restricted-properties because we are testing deepEqual!
|
||||
/* eslint-disable no-restricted-properties */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user