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