From: Ardis Lu Date: Thu, 30 Jan 2025 05:07:51 +0000 (-0800) Subject: Fix broken test X-Git-Tag: v0.1.0~75 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=e14c91d8fcdb0dab0cb50ee0ad2a2cf0087a8261;p=csvio Fix broken test Was previously passing by coincidence. Added an additional check to compare the actual rows vs. status rows. --- diff --git a/test/core.test.js b/test/core.test.js index 5bb3f9c..fbaa8af 100644 --- a/test/core.test.js +++ b/test/core.test.js @@ -584,8 +584,14 @@ suite('CSVWriter status', { concurrency: true }, () => { t.after(async () => await unlink(temp)); const writer = new CSVWriter(temp); await createCSVMockStream([['']]) - .pipeThrough(new CSVTransformer(() => 'row 1,a\r\nrow 2,b\r\nrow 3,c'), { handleHeaders: true, rawOutput: true }) + .pipeThrough(new CSVTransformer(() => 'row 1,a\r\nrow 2,b\r\nrow 3,c', { handleHeaders: true, rawOutput: true })) .pipeTo(writer); deepStrictEqual(writer.status.rows, 1); + await new CSVReader(temp) + .pipeTo(csvStreamEqualWritable([ + ['row 1', 'a'], + ['row 2', 'b'], + ['row 3', 'c'] + ])); }); }); \ No newline at end of file