fix(tstest): Improve timeout warning timer management and summary output formatting in the test runner.

This commit is contained in:
2025-05-26 14:04:40 +00:00
parent 91b99ce304
commit 9464c17c15
4 changed files with 65 additions and 23 deletions

View File

@@ -242,9 +242,11 @@ export class TsTestLogger {
if (!this.options.quiet) {
const total = passed + failed;
const status = failed === 0 ? 'PASSED' : 'FAILED';
const color = failed === 0 ? 'green' : 'red';
this.log(this.format(` Summary: ${passed}/${total} ${status}`, color));
if (failed === 0) {
this.log(this.format(` Summary: ${passed}/${total} PASSED`, 'green'));
} else {
this.log(this.format(` Summary: ${passed} passed, ${failed} failed of ${total} tests`, 'red'));
}
}
// If using --logfile, handle error copy and diff detection
@@ -390,7 +392,11 @@ export class TsTestLogger {
if (this.options.quiet) {
const status = summary.totalFailed === 0 ? 'PASSED' : 'FAILED';
this.log(`\nSummary: ${summary.totalPassed}/${summary.totalTests} | ${totalDuration}ms | ${status}`);
if (summary.totalFailed === 0) {
this.log(`\nSummary: ${summary.totalPassed}/${summary.totalTests} | ${totalDuration}ms | ${status}`);
} else {
this.log(`\nSummary: ${summary.totalPassed} passed, ${summary.totalFailed} failed of ${summary.totalTests} tests | ${totalDuration}ms | ${status}`);
}
return;
}