From 93aa56f36de9ed67963132fc5b7e0a737e1990bd Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Wed, 2 Jul 2025 23:48:17 -0700 Subject: [PATCH] Add test to remove empty columns --- test/normalization.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/normalization.test.js b/test/normalization.test.js index c2c29ce..abd3521 100644 --- a/test/normalization.test.js +++ b/test/normalization.test.js @@ -239,6 +239,21 @@ suite('CSVNormalizer', { concurrency: true }, () => { ['a', 'b'] ])); }); + test('can remove empty columns', { concurrency: true }, async () => { + await createCSVMockStream([ + ['columnA', '', 'columnB', '', ''], + ['a', '', 'b', '', ''] + ]) + .pipeThrough(new CSVNormalizer([ + { name: 'columnA', type: 'string' }, + { name: 'columnB', type: 'string' } + ])) + .pipeThrough(new CSVDenormalizer()) + .pipeTo(csvStreamEqualWritable([ + ['columnA', 'columnB'], + ['a', 'b'] + ])); + }); test('can pass through numbers', { concurrency: true }, async () => { await createCSVMockStream([ ['columnA', 'columnB'], -- 2.47.3