( event: ReplayTestStep, options: ReplayTestProgressFormatOptions, spinnerFrame: string, )
| 95 | } |
| 96 | |
| 97 | function formatReplayTestLiveProgressLine( |
| 98 | event: ReplayTestStep, |
| 99 | options: ReplayTestProgressFormatOptions, |
| 100 | spinnerFrame: string, |
| 101 | ): string { |
| 102 | const title = event.title?.trim(); |
| 103 | const file = path.basename(event.file); |
| 104 | const useColor = supportsColor(process.stderr); |
| 105 | const spinner = formatReplayTestProgressSpinner(spinnerFrame, { useColor }); |
| 106 | const shardSuffix = formatReplayTestProgressShardSuffix(event, { useColor }); |
| 107 | const stepSuffix = formatReplayTestLiveProgressStepSuffix(event, { useColor }); |
| 108 | const suffix = `${shardSuffix}${stepSuffix}`; |
| 109 | const prefix = `${spinner} `; |
| 110 | if (!title) return trimToColumns(`${prefix}${file}${suffix}`, options.columns); |
| 111 | |
| 112 | const availableTitleColumns = Math.max( |
| 113 | 0, |
| 114 | resolveColumns(options.columns) - visibleLength(prefix) - visibleLength(suffix), |
| 115 | ); |
| 116 | const formattedTitle = trimToColumns(title, availableTitleColumns); |
| 117 | return trimToColumns(`${prefix}${formattedTitle}${suffix}`, options.columns); |
| 118 | } |
| 119 | |
| 120 | function formatReplayTestProgressSpinner( |
| 121 | frame: string, |
no test coverage detected