Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
bzoz committed Jan 31, 2018
commit 0a53f6dc080bd3ebc71e8a19a96d3e55e5b416f4
2 changes: 1 addition & 1 deletion test/parallel/test-tty-get-color-depth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down