diff options
author | Marvin Hagemeister <marvin@deno.com> | 2024-10-24 11:46:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-24 11:46:51 +0200 |
commit | ef53ce3ac40e2c545397669e61e4e92423555d94 (patch) | |
tree | ce14ce6eddd4ee95f1f1b5695ea52357a00097a0 /tests/unit_node | |
parent | 79a3ad2b950009f560641cea359d7deb6f7a61ac (diff) |
fix(node/util): support array formats in `styleText` (#26507)
We missed adding support for an array of formats being passed to
`util.styleText`.
Fixes https://github.com/denoland/deno/issues/26496
Diffstat (limited to 'tests/unit_node')
-rw-r--r-- | tests/unit_node/util_test.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit_node/util_test.ts b/tests/unit_node/util_test.ts index a47c231a1..6267018b1 100644 --- a/tests/unit_node/util_test.ts +++ b/tests/unit_node/util_test.ts @@ -353,3 +353,8 @@ Deno.test("[util] styleText()", () => { const redText = util.styleText("red", "error"); assertEquals(redText, "\x1B[31merror\x1B[39m"); }); + +Deno.test("[util] styleText() with array of formats", () => { + const colored = util.styleText(["red", "green"], "error"); + assertEquals(colored, "\x1b[32m\x1b[31merror\x1b[39m\x1b[39m"); +}); |