1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 08:39:09 -05:00

feat: print test status on the same line as test name (denoland/deno_std#100)

Original: 41a2d21826
This commit is contained in:
Yoshiya Hinosawa 2019-01-10 00:32:37 +09:00 committed by Ryan Dahl
parent fc20b977c0
commit 6f8dc44a2b

View file

@ -125,20 +125,24 @@ async function runTests() {
for (let i = 0; i < tests.length; i++) { for (let i = 0; i < tests.length; i++) {
const { fn, name } = tests[i]; const { fn, name } = tests[i];
let result = green_ok(); 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 { try {
await fn(); await fn();
passed++; passed++;
console.log("...", result);
console.groupEnd();
} catch (e) { } catch (e) {
result = red_failed(); result = red_failed();
console.log("...", result);
console.groupEnd();
console.error((e && e.stack) || e); console.error((e && e.stack) || e);
failed++; failed++;
if (exitOnFail) { if (exitOnFail) {
break; 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. // Attempting to match the output of Rust's test runner.