(pages: Row[][])
| 21 | type Row = { id: string; ts: string } |
| 22 | |
| 23 | function makeSource(pages: Row[][]) { |
| 24 | return { |
| 25 | type: 'workflow_logs' as const, |
| 26 | displayName: 'Test', |
| 27 | pages: vi.fn(async function* () { |
| 28 | for (const page of pages) yield page |
| 29 | }), |
| 30 | serialize: vi.fn((row: Row) => row), |
| 31 | cursorAfter: vi.fn((row: Row) => JSON.stringify({ ts: row.ts, id: row.id })), |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | function makeDestination( |
| 36 | opts: { deliver?: ReturnType<typeof vi.fn>; close?: ReturnType<typeof vi.fn> } = {} |