]> git.ardis.lu - csvio/commitdiff
Add test to remove empty columns
authorArdis Lu <ardisglu@gmail.com>
Thu, 3 Jul 2025 06:48:17 +0000 (23:48 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 3 Jul 2025 06:48:17 +0000 (23:48 -0700)
test/normalization.test.js

index c2c29ce4e0fb56570235a4c4e2d8980ac5fb19f4..abd35216f35a26780003d80f04b1175837611368 100644 (file)
@@ -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'],
This page took 0.037124 seconds and 4 git commands to generate.