summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2019-01-10 00:32:37 +0900
committerRyan Dahl <ry@tinyclouds.org>2019-01-09 10:32:37 -0500
commit6f8dc44a2b218bac3fb3ebb1035cbbd10160b48b (patch)
tree3f658ea7f4f048d5eb7469f6d5e510ac22c4b09d
parentfc20b977c0aa655b911fcaea070ce77d0c3b9eee (diff)
feat: print test status on the same line as test name (denoland/deno_std#100)
Original: https://github.com/denoland/deno_std/commit/41a2d218264b2f9217bf793893aff5dadd2c4ca9
-rw-r--r--testing/mod.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/testing/mod.ts b/testing/mod.ts
index 2200020f6..96fe3f11f 100644
--- a/testing/mod.ts
+++ b/testing/mod.ts
@@ -125,20 +125,24 @@ async function runTests() {
for (let i = 0; i < tests.length; i++) {
const { fn, name } = tests[i];
let result = green_ok();
- console.log("test", name);
+ // See https://github.com/denoland/deno/pull/1452
+ // about this usage of groupCollapsed
+ console.groupCollapsed(`test ${name} `);
try {
await fn();
passed++;
+ console.log("...", result);
+ console.groupEnd();
} catch (e) {
result = red_failed();
+ console.log("...", result);
+ console.groupEnd();
console.error((e && e.stack) || e);
failed++;
if (exitOnFail) {
break;
}
}
- // TODO Do this on the same line as test name is printed.
- console.log("...", result);
}
// Attempting to match the output of Rust's test runner.