]> git.ardis.lu - csvio/commitdiff
Fix broken test
authorArdis Lu <ardisglu@gmail.com>
Thu, 30 Jan 2025 05:07:51 +0000 (21:07 -0800)
committerArdis Lu <ardisglu@gmail.com>
Thu, 30 Jan 2025 05:07:51 +0000 (21:07 -0800)
Was previously passing by coincidence. Added an additional check to compare the actual rows vs. status rows.

test/core.test.js

index 5bb3f9cbf71981ed008af52906424194d73d1b3d..fbaa8af4485ab527861d1f4b181087e398a2219c 100644 (file)
@@ -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
This page took 0.050739 seconds and 4 git commands to generate.