summaryrefslogtreecommitdiff
path: root/cli/rt/40_testing.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-10-15 12:32:03 +0200
committerGitHub <noreply@github.com>2020-10-15 12:32:03 +0200
commitbd0c64b9aeeb75eea25402b0ebd5aecc2cec8e3a (patch)
treef9b52b421b9cd32520359223910a388c95f4d97f /cli/rt/40_testing.js
parent81635c59e66b81a4c85aed6775aff4beedf71f14 (diff)
Reland feat(cli/console): inspect with colors regardless of Deno.noColor (#7976)
Diffstat (limited to 'cli/rt/40_testing.js')
-rw-r--r--cli/rt/40_testing.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/rt/40_testing.js b/cli/rt/40_testing.js
index c374e0ca6..082d17fe0 100644
--- a/cli/rt/40_testing.js
+++ b/cli/rt/40_testing.js
@@ -2,7 +2,7 @@
((window) => {
const core = window.Deno.core;
- const { gray, green, italic, red, yellow } = window.__bootstrap.colors;
+ const colors = window.__bootstrap.colors;
const { exit } = window.__bootstrap.os;
const { Console, inspectArgs } = window.__bootstrap.console;
const { stdout } = window.__bootstrap.files;
@@ -19,6 +19,8 @@
}
function formatDuration(time = 0) {
+ const gray = colors.maybeColor(colors.gray);
+ const italic = colors.maybeColor(colors.italic);
const timeStr = `(${time}ms)`;
return gray(italic(timeStr));
}
@@ -139,6 +141,9 @@ finishing test case.`;
}
function reportToConsole(message) {
+ const green = colors.maybeColor(colors.green);
+ const red = colors.maybeColor(colors.red);
+ const yellow = colors.maybeColor(colors.yellow);
const redFailed = red("FAILED");
const greenOk = green("ok");
const yellowIgnored = yellow("ignored");