Add file label and dim timing to summary
This commit is contained in:
parent
24314c9c95
commit
f0c9dc8009
|
|
@ -253,7 +253,8 @@ program
|
||||||
}
|
}
|
||||||
|
|
||||||
const elapsed = performance.now() - start
|
const elapsed = performance.now() - start
|
||||||
console.log(formatSummary(results, elapsed))
|
const singleFile = files.length === 1 ? relative(cwd, files[0]) : undefined
|
||||||
|
console.log(formatSummary(results, elapsed, singleFile))
|
||||||
|
|
||||||
process.exit(failures.length > 0 ? 1 : 0)
|
process.exit(failures.length > 0 ? 1 : 0)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ export function formatFailure(test: TestResult): string {
|
||||||
export function formatSummary(
|
export function formatSummary(
|
||||||
results: TestResult[],
|
results: TestResult[],
|
||||||
elapsed: number,
|
elapsed: number,
|
||||||
|
singleFile?: string,
|
||||||
): string {
|
): string {
|
||||||
const totalCommands = results.reduce((n, r) => n + r.commandCount, 0)
|
const totalCommands = results.reduce((n, r) => n + r.commandCount, 0)
|
||||||
const failedCommands = results.reduce((n, r) => n + r.failures.length, 0)
|
const failedCommands = results.reduce((n, r) => n + r.failures.length, 0)
|
||||||
|
|
@ -118,5 +119,6 @@ export function formatSummary(
|
||||||
? `${Math.round(elapsed)}ms`
|
? `${Math.round(elapsed)}ms`
|
||||||
: `${(elapsed / 1000).toFixed(1)}s`
|
: `${(elapsed / 1000).toFixed(1)}s`
|
||||||
|
|
||||||
return `${parts.join(", ")} in ${time}`
|
const label = singleFile ? ` in ${singleFile}` : ""
|
||||||
|
return `${parts.join(", ")}${label} ${ansis.dim(`[${time}]`)}`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user