diff options
author | Marvin Hagemeister <marvin@deno.com> | 2024-08-19 17:13:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-19 17:13:09 +0200 |
commit | 48701c19f8b2661c7e2cd997e62070d74baa86d0 (patch) | |
tree | 5c25a7f8c8d4b51fa7ed2475edb7a8f5ce5f417d /tests/unit_node/tty_test.ts | |
parent | c94c5cddb137069640fc9fc61435204d6f63fc5d (diff) |
fix(node/tty): fix `tty.WriteStream.hasColor` with different args (#25094)
The check in `tty.WriteStream.prototype.hasColors()` was incorrect
leading to the
[`yoctocolors`](https://github.com/sindresorhus/yoctocolors) package not
printing any colors.
Fixes https://github.com/denoland/deno/issues/24407
Diffstat (limited to 'tests/unit_node/tty_test.ts')
-rw-r--r-- | tests/unit_node/tty_test.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/unit_node/tty_test.ts b/tests/unit_node/tty_test.ts index ab3193f4a..7f0395682 100644 --- a/tests/unit_node/tty_test.ts +++ b/tests/unit_node/tty_test.ts @@ -38,6 +38,10 @@ Deno.test("[node/tty WriteStream.isTTY] returns true when fd is a tty", () => { Deno.test("[node/tty WriteStream.hasColors] returns true when colors are supported", () => { assert(tty.WriteStream.prototype.hasColors() === !Deno.noColor); + assert(tty.WriteStream.prototype.hasColors({}) === !Deno.noColor); + + assert(tty.WriteStream.prototype.hasColors(1)); + assert(tty.WriteStream.prototype.hasColors(1, {})); }); Deno.test("[node/tty WriteStream.getColorDepth] returns current terminal color depth", () => { |