(docs: ReturnType<typeof sourceRow>[])
| 368 | }) |
| 369 | |
| 370 | function makeTx(docs: ReturnType<typeof sourceRow>[]) { |
| 371 | const inserted: Array<Record<string, unknown>> = [] |
| 372 | let selectCalled = false |
| 373 | const tx = { |
| 374 | select: () => { |
| 375 | selectCalled = true |
| 376 | return { from: () => ({ where: () => Promise.resolve(docs) }) } |
| 377 | }, |
| 378 | insert: () => ({ |
| 379 | values: (rows: Array<Record<string, unknown>>) => { |
| 380 | inserted.push(...rows) |
| 381 | return Promise.resolve() |
| 382 | }, |
| 383 | }), |
| 384 | } |
| 385 | return { tx: tx as unknown as DbOrTx, inserted, wasSelectCalled: () => selectCalled } |
| 386 | } |
| 387 | |
| 388 | const mappedKbResolver: ForkReferenceResolver = (kind, id) => |
| 389 | kind === 'knowledge-base' && id === 'src-kb' ? 'target-kb' : null |
no test coverage detected