diff options
author | cjihrig <cjihrig@gmail.com> | 2018-05-13 09:28:25 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-05-14 23:39:29 -0400 |
commit | ee2a7703e78a410fff8051dd842ef1352f73af31 (patch) | |
tree | 0758a8cf4df6547c622bbc2593a13a4316c3c607 /test/parallel/test-assert-checktag.js | |
parent | 7597d45beeba0faa8058c369514274a7d166e6a2 (diff) | |
download | android-node-v8-ee2a7703e78a410fff8051dd842ef1352f73af31.tar.gz android-node-v8-ee2a7703e78a410fff8051dd842ef1352f73af31.tar.bz2 android-node-v8-ee2a7703e78a410fff8051dd842ef1352f73af31.zip |
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>
Diffstat (limited to 'test/parallel/test-assert-checktag.js')
-rw-r--r-- | test/parallel/test-assert-checktag.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/parallel/test-assert-checktag.js b/test/parallel/test-assert-checktag.js index 38ebaa1a14..70a67e15d3 100644 --- a/test/parallel/test-assert-checktag.js +++ b/test/parallel/test-assert-checktag.js @@ -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 */ |