fix(node): make process.stdout.isTTY writable (#26130)

Fixes https://github.com/denoland/deno/issues/26123
This commit is contained in:
Marvin Hagemeister 2024-10-11 19:14:10 +02:00 committed by GitHub
parent 94b588ce66
commit 9117a9a43c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -691,6 +691,16 @@ Deno.test({
assertStrictEquals(process.stdout.clearLine, undefined);
assertStrictEquals(process.stdout.clearScreenDown, undefined);
}
// Allows overwriting `process.stdout.isTTY`
// https://github.com/denoland/deno/issues/26123
const original = process.stdout.isTTY;
try {
process.stdout.isTTY = !isTTY;
assertEquals(process.stdout.isTTY, !isTTY);
} finally {
process.stdout.isTTY = original;
}
},
});