MCPcopy Index your code
hub / github.com/angular/angular / compare

Function compare

packages/core/schematics/utils/tsurge/testing/jasmine.ts:27–44  ·  view source on GitHub ↗
(actual: string, expected: string)

Source from the content-addressed store, hash-verified

25 toMatchWithDiff: () => {
26 return {
27 compare(actual: string, expected: string) {
28 actual = dedent`${actual}`;
29 expected = dedent`${expected}`;
30
31 if (actual === expected) {
32 return {pass: true};
33 }
34
35 const diffWithColors = diffText(expected, actual);
36 return {
37 pass: false,
38 message:
39 `${chalk.bold('Expected contents to match.')}\n\n` +
40 ` - ${chalk.green('■■■■■■■')}: Unexpected text in your test assertion.\n` +
41 ` - ${chalk.red(`■■■■■■■`)}: Text that is missing in your assertion.\n` +
42 `${chalk.bold('Diff below')}:\n${diffWithColors}`,
43 };
44 },
45 };
46 },
47 });

Callers

nothing calls this directly

Calls 2

dedentFunction · 0.90
diffTextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…