(initialHistory?: RouterHistory)
| 14 | }) |
| 15 | |
| 16 | function createTestRouter(initialHistory?: RouterHistory) { |
| 17 | const history = |
| 18 | initialHistory ?? createMemoryHistory({ initialEntries: ['/'] }) |
| 19 | |
| 20 | const rootRoute = createRootRoute({}) |
| 21 | const indexRoute = createRoute({ getParentRoute: () => rootRoute, path: '/' }) |
| 22 | const postsRoute = createRoute({ |
| 23 | getParentRoute: () => rootRoute, |
| 24 | path: '/posts', |
| 25 | }) |
| 26 | const postIdRoute = createRoute({ |
| 27 | getParentRoute: () => postsRoute, |
| 28 | path: '/$slug', |
| 29 | }) |
| 30 | const projectRoute = createRoute({ |
| 31 | getParentRoute: () => rootRoute, |
| 32 | path: '/p', |
| 33 | }) |
| 34 | const projectIdRoute = createRoute({ |
| 35 | getParentRoute: () => projectRoute, |
| 36 | path: '/$projectId', |
| 37 | }) |
| 38 | const projectVersionRoute = createRoute({ |
| 39 | getParentRoute: () => projectIdRoute, |
| 40 | path: '/$version', |
| 41 | }) |
| 42 | const projectFrameRoute = createRoute({ |
| 43 | getParentRoute: () => projectVersionRoute, |
| 44 | path: '/$framework', |
| 45 | }) |
| 46 | |
| 47 | const uRoute = createRoute({ |
| 48 | getParentRoute: () => rootRoute, |
| 49 | path: '/u', |
| 50 | }) |
| 51 | const uLayoutRoute = createRoute({ |
| 52 | id: '_layout', |
| 53 | getParentRoute: () => uRoute, |
| 54 | }) |
| 55 | const uUsernameRoute = createRoute({ |
| 56 | getParentRoute: () => uLayoutRoute, |
| 57 | path: '$username', |
| 58 | }) |
| 59 | |
| 60 | const gRoute = createRoute({ |
| 61 | getParentRoute: () => rootRoute, |
| 62 | path: '/g', |
| 63 | }) |
| 64 | const gLayoutRoute = createRoute({ |
| 65 | id: 'layout', |
| 66 | getParentRoute: () => gRoute, |
| 67 | }) |
| 68 | const gUsernameRoute = createRoute({ |
| 69 | getParentRoute: () => gLayoutRoute, |
| 70 | path: '$username', |
| 71 | }) |
| 72 | const searchRoute = createRoute({ |
| 73 | getParentRoute: () => rootRoute, |
no test coverage detected