]> git.ardis.lu - csvio/commitdiff
Add test case for shorthand with literal names
authorArdis Lu <ardisglu@gmail.com>
Mon, 20 Oct 2025 05:42:50 +0000 (22:42 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 20 Oct 2025 05:42:50 +0000 (22:42 -0700)
test/normalization.test.js

index 97bbc0fc754c1f88f7b6235df525a115f42d9df4..e6a92f4dbacc3dd407c61b61b72cf9c616ccd2b9 100644 (file)
@@ -282,6 +282,18 @@ suite('CSVNormalizer', { concurrency: true }, () => {
         ['a', 'b']
       ]));
   });
+  test('accepts string shorthand with literal names', { concurrency: true }, async () => {
+    await createCSVMockStream([
+      ['columnA', 'column_A', 'column A'],
+      ['1', '2', '3']
+    ])
+      .pipeThrough(new CSVNormalizer(['columnA', 'column_A', 'column A'], { useLiteralNames: true }))
+      .pipeThrough(new CSVDenormalizer())
+      .pipeTo(csvStreamEqualWritable([
+        ['columnA', 'column_A', 'column A'],
+        ['1', '2', '3']
+      ]));
+  });
   test('accepts mixed string and CSVNormalizerHeader to set headers', { concurrency: true }, async () => {
     await createCSVMockStream([
       ['columnA', 'columnB'],
This page took 0.037066 seconds and 4 git commands to generate.