]> git.ardis.lu - csvio/commitdiff
Add explicit test for undefined
authorArdis Lu <ardisglu@gmail.com>
Wed, 12 Nov 2025 05:16:01 +0000 (21:16 -0800)
committerArdis Lu <ardisglu@gmail.com>
Wed, 12 Nov 2025 05:16:01 +0000 (21:16 -0800)
test/core.test.js

index 0d3f70818e0aa933abe736d087d197b1ab00e176..9bd6c0b9713f7e3691b7ae876ff65ef4c67ca49b 100644 (file)
@@ -360,6 +360,25 @@ suite('CSVTransformer', { concurrency: true }, () => {
         ['a', 'b'],
       ]));
   });
+  test('consumes input row without output row when undefined is returned', { concurrency: true }, async () => {
+    await createCSVMockStream([
+      ['columnA', 'columnB'],
+      ['delete'],
+      ['a', 'b'],
+      ['delete'],
+      ['a', 'b'],
+      ['delete'],
+      ['a', 'b'],
+      ['delete']
+    ])
+      .pipeThrough(new CSVTransformer(r => r[0] === 'delete' ? undefined : r))
+      .pipeTo(csvStreamEqualWritable([
+        ['columnA', 'columnB'],
+        ['a', 'b'],
+        ['a', 'b'],
+        ['a', 'b'],
+      ]));
+  });
   test('passes through header row when handleHeaders is true', { concurrency: true }, async () => {
     await createCSVMockStream([
       ['a', 'b'],
This page took 0.038362 seconds and 4 git commands to generate.