/* eslint-disable */ import { describe, it, expect } from 'vitest' import { getRouteApi, createRoute } from '../src' describe('getRouteApi', () => { it('should have the useRouteContext hook', () => { const api = getRouteApi('foo') expect(api.useRouteContext).toBeDefined() }) it('should have the useParams hook', () => { const api = getRouteApi('foo') expect(api.useParams).toBeDefined() }) }) describe('createRoute has the same hooks as getRouteApi', () => { const routeApi = getRouteApi('foo') const hookNames = Object.keys(routeApi).filter((key) => key.startsWith('use')) const route = createRoute({} as any) it.each(hookNames.map((name) => [name]))( 'should have the "%s" hook defined', (hookName) => { expect(route[hookName as keyof typeof route]).toBeDefined() }, ) })