(csv: string, delimiter = ',')
| 280 | |
| 281 | describe('createCsvParser', () => { |
| 282 | async function parseViaStream(csv: string, delimiter = ',') { |
| 283 | const parser = createCsvParser(delimiter) |
| 284 | Readable.from([csv]).pipe(parser) |
| 285 | const rows: Record<string, unknown>[] = [] |
| 286 | for await (const record of parser as AsyncIterable<Record<string, unknown>>) { |
| 287 | rows.push(record) |
| 288 | } |
| 289 | return rows |
| 290 | } |
| 291 | |
| 292 | it('streams records keyed by header, matching parseCsvBuffer', async () => { |
| 293 | const csv = 'name,age\nAlice,30\nBob,40\n' |
no test coverage detected