mirror of
https://github.com/denoland/deno.git
synced 2024-12-29 02:29:06 -05:00
feat: print test status on the same line as test name (#100)
This commit is contained in:
parent
72b2e20f9d
commit
41a2d21826
1 changed files with 7 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue