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