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

Function checkRoutes

adev/src/app/routing/redirections.spec.ts:17–30  ·  view source on GitHub ↗
(routes: Route[])

Source from the content-addressed store, hash-verified

15describe('REDIRECT_ROUTES', () => {
16 it('should have all redirectTo values starting with a "/"', () => {
17 const checkRoutes = (routes: Route[]) => {
18 for (const route of routes) {
19 if (route.redirectTo) {
20 if (typeof route.redirectTo === 'string') {
21 expect(route.redirectTo.startsWith('/'))
22 .withContext(`Invalid redirectTo: ${route.redirectTo}`)
23 .toBe(true);
24 }
25 }
26 if (route.children) {
27 checkRoutes(route.children);
28 }
29 }
30 };
31
32 checkRoutes(REDIRECT_ROUTES);
33 });

Callers 1

Calls 3

withContextMethod · 0.80
hasMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected