fix(tstest): Improve timeout warning timer management and summary output formatting in the test runner.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user