MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / formatDiffText

Function formatDiffText

test/conductor/diff-utils.ts:66–79  ·  view source on GitHub ↗
(assertionDiff: any[])

Source from the content-addressed store, hash-verified

64}
65
66export function formatDiffText(assertionDiff: any[]): string|null {
67 const diffLines =
68 Array.from(formatDiff(assertionDiff, same => ` ${same}`, actual => `+${actual}`, expected => `-${expected}`));
69
70 if (diffLines.length > 0) {
71 return [
72 '- expected',
73 '+ actual',
74 '',
75 ...diffLines,
76 ].join('\n');
77 }
78 return null;
79}
80// The max length of the summary is 4000, but we need to leave some room for
81// the rest of the HTML formatting (e.g. <pre> and </pre>).
82const SUMMARY_LENGTH_CUTOFF = 3950;

Callers 1

formatAsHtmlFunction · 0.85

Calls 3

formatDiffFunction · 0.85
fromMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected