summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBartosz Sosnowski <bartosz@janeasystems.com>2018-01-31 16:48:21 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-01 11:58:38 +0100
commitef2861961c3d9e9ed6972e1e84d969683b25cf95 (patch)
tree0147956853ad414b59dbcebf3f33194d8207d901 /test
parent0c16b1804302046082ce5322b65e09a30172d606 (diff)
downloadandroid-node-v8-ef2861961c3d9e9ed6972e1e84d969683b25cf95.tar.gz
android-node-v8-ef2861961c3d9e9ed6972e1e84d969683b25cf95.tar.bz2
android-node-v8-ef2861961c3d9e9ed6972e1e84d969683b25cf95.zip
test: fix test-tty-get-color-depth
If getTTYfd returns 0, and stdin is not writable (like on Windows), trying to create WriteStream will fail. This commit fixes that by skipping fd 0. PR-URL: https://github.com/nodejs/node/pull/18478 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-tty-get-color-depth.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/parallel/test-tty-get-color-depth.js b/test/parallel/test-tty-get-color-depth.js
index a5a998b6a3..a4c7ffacd1 100644
--- a/test/parallel/test-tty-get-color-depth.js
+++ b/test/parallel/test-tty-get-color-depth.js
@@ -10,7 +10,7 @@ const { WriteStream } = require('tty');
// Do our best to grab a tty fd.
function getTTYfd() {
- const ttyFd = [0, 1, 2, 4, 5].find(tty.isatty);
+ const ttyFd = [1, 2, 4, 5].find(tty.isatty);
if (ttyFd === undefined) {
try {
return openSync('/dev/tty');