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

Function wholeProjectReads

__tests__/parameter-flow.test.ts:401–415  ·  view source on GitHub ↗

Index `files`, counting how often the whole project's text was read for a flow.

(files: Record<string, string>)

Source from the content-addressed store, hash-verified

399
400 /** Index `files`, counting how often the whole project's text was read for a flow. */
401 async function wholeProjectReads(files: Record<string, string>): Promise<number> {
402 let reads = 0;
403 const adapter = rubyParameterFlow.adapter.bind(rubyParameterFlow);
404 vi.spyOn(rubyParameterFlow, 'adapter').mockImplementation((...args) => {
405 const made = adapter(...args);
406 const written = made.written.bind(made);
407 made.written = (names, files) => {
408 reads++;
409 return written(names, files);
410 };
411 return made;
412 });
413 await indexed(files);
414 return reads;
415 }
416
417 it('reads the whole project only when a flow would change something', async () => {
418 expect(await wholeProjectReads(BASE)).toBe(1);

Callers 1

Calls 4

adapterFunction · 0.85
writtenFunction · 0.85
bindMethod · 0.80
indexedFunction · 0.70

Tested by

no test coverage detected