MCPcopy Create free account
hub / github.com/angular/angular / compareSegments

Function compareSegments

packages/router/test/apply_redirects.spec.ts:2012–2021  ·  view source on GitHub ↗
(actual: UrlSegmentGroup, expected: UrlSegmentGroup, error: string)

Source from the content-addressed store, hash-verified

2010}
2011
2012function compareSegments(actual: UrlSegmentGroup, expected: UrlSegmentGroup, error: string): void {
2013 expect(actual).toBeDefined(error);
2014 expect(equalSegments(actual.segments, expected.segments)).toEqual(true, error);
2015
2016 expect(Object.keys(actual.children).length).toEqual(Object.keys(expected.children).length, error);
2017
2018 Object.keys(expected.children).forEach((key) => {
2019 compareSegments(actual.children[key], expected.children[key], error);
2020 });
2021}
2022
2023class ComponentA {}
2024class ComponentB {}

Callers 1

expectTreeToBeFunction · 0.70

Calls 3

equalSegmentsFunction · 0.90
keysMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected