MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / fakeIndex

Function fakeIndex

graph-ui/src/traces/bug-paths.test.ts:69–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67};
68
69function fakeIndex(): BugPathIndex & { queries: string[] } {
70 const queries: string[] = [];
71 return {
72 queries,
73 async queryRows(project, query) {
74 expect(project).toBe(PROJECT);
75 queries.push(query);
76 const incoming = /b\.qualified_name = "([^"]+)"/.exec(query);
77 if (incoming !== null) {
78 return (CALLERS[incoming[1]] ?? []).map((caller) => ({
79 [COLUMNS.callsIn[0]]: caller.name,
80 [COLUMNS.callsIn[1]]: caller.qualifiedName,
81 [COLUMNS.callsIn[2]]: caller.filePath,
82 [COLUMNS.callsIn[3]]: String(caller.line),
83 [COLUMNS.callsIn[4]]: 'false',
84 [COLUMNS.callsIn[5]]: '1',
85 }));
86 }
87 if (query.includes('MATCH (n:Function)') || query.includes('MATCH (n:Method)')) {
88 const wanted = [...query.matchAll(/n\.file_path = "([^"]+)"/g)].map((match) => match[1]);
89 return DECLARATIONS
90 .filter((entry) => wanted.includes(entry.filePath) && query.includes('(n:Function)'))
91 .map((entry) => ({
92 [COLUMNS.declarations[0]]: entry.name,
93 [COLUMNS.declarations[1]]: entry.qualifiedName,
94 [COLUMNS.declarations[2]]: entry.filePath,
95 [COLUMNS.declarations[3]]: String(entry.line),
96 [COLUMNS.declarations[4]]: String(entry.line + 4),
97 [COLUMNS.declarations[5]]: 'false',
98 }));
99 }
100 return [];
101 },
102 };
103}
104
105const OBSERVED = { count: 3, label: 'smoke-run', lastSeen: '2026-08-28T19:42:14Z' };
106

Callers 2

bug-paths.test.tsFile · 0.85
queryRowsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected