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

Function pendingWithPool

__tests__/resolver-pool-pipeline.test.ts:161–171  ·  view source on GitHub ↗

References no node answers to, and a pool whose start goes as `ready` says, that nothing should reach.

(ready: () => Promise<void>)

Source from the content-addressed store, hash-verified

159
160 /** References no node answers to, and a pool whose start goes as `ready` says, that nothing should reach. */
161 function pendingWithPool(ready: () => Promise<void>): { refs: number; destroy: ReturnType<typeof vi.fn>; resolveBatch: ReturnType<typeof vi.fn>; tryCreate: ReturnType<typeof vi.spyOn> } {
162 const refs = Array.from({ length: 12 }, (_, i): UnresolvedReference => ({
163 fromNodeId: 'fn:a', referenceName: `missing${i}`, referenceKind: 'calls',
164 line: 1, column: i, filePath: 'a.ts', language: 'typescript',
165 }));
166 q.insertUnresolvedRefsBatch(refs);
167 const destroy = vi.fn(async () => undefined);
168 const resolveBatch = vi.fn();
169 const tryCreate = vi.spyOn(ResolverPool, 'tryCreate').mockReturnValue({ ready, destroy, resolveBatch, shareScans: () => undefined } as unknown as ResolverPool);
170 return { refs: refs.length, destroy, resolveBatch, tryCreate };
171 }
172
173 const resolve = (): Promise<unknown> => createResolver(dir, q).resolveAndPersistBatched(undefined, 4, undefined, { dbPath: path.join(dir, 'test.db') }, false);
174

Callers 1

Calls 2

fromMethod · 0.80

Tested by

no test coverage detected