MCPcopy Create free account
hub / github.com/angular/dev-infra / compareGoldens

Function compareGoldens

ng-dev/ts-circular-dependencies/golden.ts:45–59  ·  view source on GitHub ↗
(actual: Golden, expected: Golden)

Source from the content-addressed store, hash-verified

43 * added circular dependencies, or fixed circular dependencies.
44 */
45export function compareGoldens(actual: Golden, expected: Golden) {
46 const newCircularDeps: CircularDependency[] = [];
47 const fixedCircularDeps: CircularDependency[] = [];
48 actual.forEach((a) => {
49 if (!expected.find((e) => isSameCircularDependency(a, e))) {
50 newCircularDeps.push(a);
51 }
52 });
53 expected.forEach((e) => {
54 if (!actual.find((a) => isSameCircularDependency(e, a))) {
55 fixedCircularDeps.push(e);
56 }
57 });
58 return {newCircularDeps, fixedCircularDeps};
59}
60
61/**
62 * Normalizes the a circular dependency by ensuring that the path starts with the first

Callers 1

mainFunction · 0.85

Calls 2

isSameCircularDependencyFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected