From 0a53f6dc080bd3ebc71e8a19a96d3e55e5b416f4 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 31 Jan 2018 16:48:21 +0100 Subject: [PATCH] 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. --- test/parallel/test-tty-get-color-depth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-tty-get-color-depth.js b/test/parallel/test-tty-get-color-depth.js index a5a998b6a3ab78..a4c7ffacd17f82 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');