diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-09-30 03:59:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 12:59:50 +1000 |
commit | 27ee4b255107d8e074c06b57927b7349f4edd044 (patch) | |
tree | 26bd3ba6f4de79c6873eaa5bf99432b5f04ae3d9 /cli/tests/unit/console_test.ts | |
parent | 2184cf5c07b2b78ebf586b032f45ce113670262d (diff) |
feat(cli/console): Add Deno.InspectOptions::colors (#7742)
Ref: https://github.com/denoland/deno/pull/7516#pullrequestreview-489567120
Diffstat (limited to 'cli/tests/unit/console_test.ts')
-rw-r--r-- | cli/tests/unit/console_test.ts | 12 |
1 files changed, 11 insertions, 1 deletions
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["); +}); |