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

Function resultAssertionsDiff

test/conductor/diff-utils.ts:46–64  ·  view source on GitHub ↗
(assertionErrors: any[])

Source from the content-addressed store, hash-verified

44}
45
46export function resultAssertionsDiff(assertionErrors: any[]) {
47 if (!assertionErrors || assertionErrors.length === 0) {
48 return [];
49 }
50 const firstError = assertionErrors[0];
51
52 if (!firstError) {
53 return [];
54 }
55
56 const formatValue = (value: any) => {
57 return (value && typeof value === 'object') ? JSON.stringify(value, null, 2) : String(value);
58 };
59
60 const expected = formatValue(firstError.expected);
61 const actual = formatValue(firstError.actual);
62
63 return diff.diffLines(expected, actual);
64}
65
66export function formatDiffText(assertionDiff: any[]): string|null {
67 const diffLines =

Callers 2

ProgressWithDiffReporterFunction · 0.85
specCompleteFunction · 0.85

Calls 1

formatValueFunction · 0.70

Tested by

no test coverage detected