(expected: TExpected, router: AnyRouter)
| 38 | const mockFn1 = vi.fn() |
| 39 | |
| 40 | export function validateSearchParams< |
| 41 | TExpected extends Partial<Record<string, string>>, |
| 42 | >(expected: TExpected, router: AnyRouter) { |
| 43 | const parsedSearch = new URLSearchParams(window.location.search) |
| 44 | expect(parsedSearch.size).toBe(Object.keys(expected).length) |
| 45 | for (const [key, value] of Object.entries(expected)) { |
| 46 | expect(parsedSearch.get(key)).toBe(value) |
| 47 | } |
| 48 | expect(router.state.location.search).toEqual(expected) |
| 49 | } |
| 50 | |
| 51 | function createTestRouter( |
| 52 | options?: RouterOptions<AnyRoute, 'never', any, any, any>, |
no test coverage detected