I have one of the quick examples (https://c2fo.github.io/fast-csv/docs/introduction/example) working
import * as fs from 'fs';
import * as path from 'path';
import * as csv from 'fast-csv';
fs.createReadStream(path.resolve(__dirname, 'assets', 'parse.csv'))
.pipe(csv.parse({ headers: true }))
.on('error', error => console.error(error))
.on('data', row => console.log(row))
.on('end', (rowCount: number) => console.log(`Parsed ${rowCount} rows`));
What can I do to cause the error condition to happen? I thought maybe trying to parse a non-csv file would cause an error, but nothing I seem to try causes an error. I'd like to have an automated test to simulate an error and make sure that part is working as expected.