summaryrefslogtreecommitdiff
path: root/tests/unit_node/tty_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_node/tty_test.ts')
-rw-r--r--tests/unit_node/tty_test.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit_node/tty_test.ts b/tests/unit_node/tty_test.ts
index 39ab4fe17..cde05b9ff 100644
--- a/tests/unit_node/tty_test.ts
+++ b/tests/unit_node/tty_test.ts
@@ -3,6 +3,7 @@
import { assert } from "@std/assert/mod.ts";
import { isatty } from "node:tty";
+import tty from "node:tty";
import process from "node:process";
Deno.test("[node/tty isatty] returns true when fd is a tty, false otherwise", () => {
@@ -34,3 +35,11 @@ Deno.test("[node/tty WriteStream.isTTY] returns true when fd is a tty", () => {
assert(Deno.stdin.isTerminal() === process.stdin.isTTY);
assert(Deno.stdout.isTerminal() === process.stdout.isTTY);
});
+
+Deno.test("[node/tty WriteStream.hasColors] returns true when colors are supported", () => {
+ assert(tty.WriteStream.prototype.hasColors() === !Deno.noColor);
+});
+
+Deno.test("[node/tty WriteStream.getColorDepth] returns current terminal color depth", () => {
+ assert([1, 4, 8, 24].includes(tty.WriteStream.prototype.getColorDepth()));
+});