From 27ee4b255107d8e074c06b57927b7349f4edd044 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 30 Sep 2020 03:59:50 +0100 Subject: feat(cli/console): Add Deno.InspectOptions::colors (#7742) Ref: https://github.com/denoland/deno/pull/7516#pullrequestreview-489567120 --- cli/tests/unit/console_test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cli/tests') diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index eb2c51aef..514b29cc2 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -8,7 +8,12 @@ // std/fmt/colors auto determines whether to put colors in or not. We need // better infrastructure here so we can properly test the colors. -import { assert, assertEquals, unitTest } from "./test_util.ts"; +import { + assert, + assertEquals, + assertStringContains, + unitTest, +} from "./test_util.ts"; import { stripColor } from "../../../std/fmt/colors.ts"; const customInspect = Deno.customInspect; @@ -1650,3 +1655,8 @@ unitTest(function inspectProxy(): void { "Proxy [ [Function: fn], { get: [Function: get] } ]", ); }); + +unitTest(function inspectColors(): void { + assertEquals(Deno.inspect(1), "1"); + assertStringContains(Deno.inspect(1, { colors: true }), "\x1b["); +}); -- cgit v1.2.3