MCPcopy Index your code
hub / github.com/callstack/agent-device / formatScreenshotDiffText

Function formatScreenshotDiffText

src/utils/output.ts:308–326  ·  view source on GitHub ↗
(data: ScreenshotDiffResult)

Source from the content-addressed store, hash-verified

306}
307
308export function formatScreenshotDiffText(data: ScreenshotDiffResult): string {
309 const useColor = supportsColor();
310 const match = data.match === true;
311 const dimensionMismatch = data.dimensionMismatch;
312
313 const lines: string[] = [];
314 lines.push(...formatScreenshotDiffStatusLines(data, useColor));
315 lines.push(...formatScreenshotDiffArtifactLines(data, match, useColor));
316
317 if (!match && !dimensionMismatch) {
318 lines.push(...formatScreenshotDiffPixelCountLines(data, useColor));
319 lines.push(...formatScreenshotDiffHintLines(data, useColor));
320 lines.push(...formatScreenshotDiffRegionLines(data, useColor));
321 lines.push(...formatScreenshotDiffOcrLines(data, useColor));
322 lines.push(...formatScreenshotDiffNonTextLines(data, useColor));
323 }
324
325 return `${lines.join('\n')}\n`;
326}
327
328function formatScreenshotDiffStatusLines(data: ScreenshotDiffResult, useColor: boolean): string[] {
329 if (data.match === true) {

Callers 2

output.test.tsFile · 0.90
diffCommandFunction · 0.90

Tested by

no test coverage detected