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

Function makeContext

__tests__/frameworks.test.ts:750–768  ·  view source on GitHub ↗
(opts: {
    files?: Record<string, string>;
    nodes?: Node[];
  })

Source from the content-addressed store, hash-verified

748 }
749
750 function makeContext(opts: {
751 files?: Record<string, string>;
752 nodes?: Node[];
753 }) {
754 const files = opts.files ?? {};
755 const all = opts.nodes ?? [];
756 return {
757 getNodesInFile: (fp: string) => all.filter((n) => n.filePath === fp),
758 getNodesByName: (name: string) => all.filter((n) => n.name === name),
759 getNodesByQualifiedName: () => [],
760 getNodesByKind: (kind: Node['kind']) => all.filter((n) => n.kind === kind),
761 fileExists: (fp: string) => files[fp] !== undefined,
762 readFile: (fp: string) => files[fp] ?? null,
763 getProjectRoot: () => '/test',
764 getAllFiles: () => Object.keys(files),
765 getNodesByLowerName: () => [],
766 getImportMappings: () => [],
767 } as any;
768 }
769
770 it('prepends RouterModule prefix to a controller route (top-level register)', () => {
771 const ctx = makeContext({

Callers 1

frameworks.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected