From: Ardis Lu Date: Wed, 12 Nov 2025 05:16:01 +0000 (-0800) Subject: Add explicit test for undefined X-Git-Tag: v0.1.10~6 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=1c154e9fbd9030fff0c0c6c3b26a06218d755d06;p=csvio Add explicit test for undefined --- diff --git a/test/core.test.js b/test/core.test.js index 0d3f708..9bd6c0b 100644 --- a/test/core.test.js +++ b/test/core.test.js @@ -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'],