From: Ardis Lu Date: Mon, 20 Oct 2025 05:42:50 +0000 (-0700) Subject: Add test case for shorthand with literal names X-Git-Tag: v0.1.8~2 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=74059cdda36a7744f22e3698688ce33b178dccb0;p=csvio Add test case for shorthand with literal names --- diff --git a/test/normalization.test.js b/test/normalization.test.js index 97bbc0f..e6a92f4 100644 --- a/test/normalization.test.js +++ b/test/normalization.test.js @@ -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'],