MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / componentOf

Function componentOf

__tests__/tanstack-router.test.ts:496–497  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

494 it('has the routes the tree declares, each bound to its component', () => {
495 expect(cg.getNodesByKind('route').map((r) => r.name).sort()).toEqual(['/', '/dashboard', '/dashboard/invoices/:invoiceId']);
496 const componentOf = (name: string): string | undefined =>
497 cg.getOutgoingEdges(route(name).id).filter((e) => e.kind === 'calls').map((e) => cg.getNode(e.target)?.name)[0];
498 expect(componentOf('/')).toBe('IndexComponent');
499 // The index under the layout is the page at `/dashboard`.
500 expect(componentOf('/dashboard')).toBe('DashboardIndexComponent');

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
routeFunction · 0.70
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected