(expected: TExpected, router: AnyRouter)
| 65 | ] as const |
| 66 | |
| 67 | export function validateSearchParams< |
| 68 | TExpected extends Partial<Record<string, string>>, |
| 69 | >(expected: TExpected, router: AnyRouter) { |
| 70 | const parsedSearch = new URLSearchParams(window.location.search) |
| 71 | expect(parsedSearch.size).toBe(Object.keys(expected).length) |
| 72 | for (const [key, value] of Object.entries(expected)) { |
| 73 | expect(parsedSearch.get(key)).toBe(value) |
| 74 | } |
| 75 | expect(router.state.location.search).toEqual(expected) |
| 76 | } |
| 77 | |
| 78 | function createTestRouter( |
| 79 | options: RouterOptions<AnyRoute, 'never', any, any, any> & |
no test coverage detected