( data: ScreenshotDiffResult, match: boolean, useColor: boolean, )
| 352 | } |
| 353 | |
| 354 | function formatScreenshotDiffArtifactLines( |
| 355 | data: ScreenshotDiffResult, |
| 356 | match: boolean, |
| 357 | useColor: boolean, |
| 358 | ): string[] { |
| 359 | if (match) return []; |
| 360 | |
| 361 | const lines: string[] = []; |
| 362 | if (data.diffPath) { |
| 363 | const relativePath = toRelativePath(data.diffPath); |
| 364 | const label = useColor ? colorize('Diff image:', 'dim') : 'Diff image:'; |
| 365 | const displayPath = useColor ? colorize(relativePath, 'green') : relativePath; |
| 366 | lines.push(` ${label} ${displayPath}`); |
| 367 | } |
| 368 | |
| 369 | if (data.currentOverlayPath) { |
| 370 | const relativePath = toRelativePath(data.currentOverlayPath); |
| 371 | const label = useColor ? colorize('Current overlay:', 'dim') : 'Current overlay:'; |
| 372 | const displayPath = useColor ? colorize(relativePath, 'green') : relativePath; |
| 373 | const refCount = toNumber(data.currentOverlayRefCount); |
| 374 | const refSuffix = refCount > 0 ? ` (${refCount} refs)` : ''; |
| 375 | lines.push(` ${label} ${displayPath}${refSuffix}`); |
| 376 | } |
| 377 | |
| 378 | return lines; |
| 379 | } |
| 380 | |
| 381 | function formatScreenshotDiffPixelCountLines( |
| 382 | data: ScreenshotDiffResult, |
no test coverage detected