summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit/tty_color_test.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/unit/tty_color_test.ts b/cli/tests/unit/tty_color_test.ts
new file mode 100644
index 000000000..d64c278bf
--- /dev/null
+++ b/cli/tests/unit/tty_color_test.ts
@@ -0,0 +1,14 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+import { assertEquals } from "./test_util.ts";
+
+// Note tests for Deno.setRaw is in integration tests.
+
+Deno.test({ permissions: { run: true } }, async function noColorIfNotTty() {
+ const p = Deno.run({
+ cmd: [Deno.execPath(), "eval", "console.log(1)"],
+ stdout: "piped",
+ });
+ const output = new TextDecoder().decode(await p.output());
+ assertEquals(output, "1\n");
+ p.close();
+});