From 381772385d0540e6a263343aa3b8f78267d80f53 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sun, 17 Aug 2025 20:08:26 -0700 Subject: [PATCH] Add test case for raw strings passed to `TransformStream` CSVWriter --- test/core.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/core.test.js b/test/core.test.js index 510b032..de0e339 100644 --- a/test/core.test.js +++ b/test/core.test.js @@ -827,4 +827,12 @@ suite('CSVWriter status', { concurrency: true }, () => { ['row 3', 'c'] ])); }); + test('counts raw CSV string as one row when TransformStream', { concurrency: true }, async (t) => { + const writer = new CSVWriter(); + const stream = createCSVMockStream([['']]) + .pipeThrough(new CSVTransformer(() => 'row 1,a\r\nrow 2,b\r\nrow 3,c', { handleHeaders: true })) + .pipeThrough(writer); + for await (const _ of stream) { } + deepStrictEqual(writer.status.rows, 1); + }); }); \ No newline at end of file -- 2.47.3