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

Function spyContext

__tests__/resolution.test.ts:434–453  ·  view source on GitHub ↗
(nodes: Node[])

Source from the content-addressed store, hash-verified

432 }));
433
434 const spyContext = (nodes: Node[]): { ctx: ResolutionContext; lookups: () => number } => {
435 let scanned = 0;
436 const ctx: ResolutionContext = {
437 getNodesInFile: () => [],
438 getNodesByName: (name) => {
439 const hit = nodes.filter((n) => n.name === name);
440 scanned += hit.length;
441 return hit;
442 },
443 getNodesByQualifiedName: () => [],
444 getNodesByKind: () => [],
445 fileExists: () => true,
446 readFile: () => null,
447 getProjectRoot: () => '/test',
448 getAllFiles: () => [],
449 getNodesByLowerName: () => [],
450 getImportMappings: () => [],
451 };
452 return { ctx, lookups: () => scanned };
453 };
454
455 it('declines a method call (`obj.init`) above the ceiling instead of scoring K candidates', () => {
456 const { ctx } = spyContext(makeManyMethods(CEILING + 1, 'init'));

Callers 1

resolution.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected