From: Ardis Lu Date: Thu, 3 Jul 2025 06:48:17 +0000 (-0700) Subject: Add test to remove empty columns X-Git-Tag: v0.1.2~7 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=93aa56f36de9ed67963132fc5b7e0a737e1990bd;p=csvio Add test to remove empty columns --- 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'],