From 1c154e9fbd9030fff0c0c6c3b26a06218d755d06 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Tue, 11 Nov 2025 21:16:01 -0800 Subject: [PATCH] Add explicit test for undefined --- test/core.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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'], -- 2.47.3