Skip to content

Commit bae6197

Browse files
feat: improve error reporting
1 parent 0f796c2 commit bae6197

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,14 @@ for (const testName of config.tests) {
260260
if (result.output) console.log(` ${DIM}${result.output}${RESET}`);
261261
} else {
262262
console.log(`${RED}✗ failed${RESET} ${DIM}(${result.durationMs}ms)${RESET}`);
263-
const indented = result.error!.split("\n").map((l) => ` ${l}`).join("\n");
264-
console.log(`${RED}${indented}${RESET}`);
263+
const lines = result.error!.split("\n");
264+
console.log(`${RED} ${lines[0]}${RESET}`);
265+
if (lines.length > 1) {
266+
const body = lines.slice(1).join("\n");
267+
console.log(`${DIM}\`\`\`${RESET}`);
268+
console.log(`${DIM}${body}${RESET}`);
269+
console.log(`${DIM}\`\`\`${RESET}`);
270+
}
265271
}
266272
}
267273

0 commit comments

Comments
 (0)