From e00edb8bb4c7107b0ddf6e2f26a18e251138c756 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 1 Jan 2026 20:21:39 -0800 Subject: [PATCH] Add empty row test --- test/normalization.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/normalization.test.js b/test/normalization.test.js index 268b52e..a50332e 100644 --- a/test/normalization.test.js +++ b/test/normalization.test.js @@ -284,6 +284,14 @@ suite('CSVNormalizer.toFieldMap', { concurrency: true }, () => { map.source.push({ name: 'c', value: 3 }); ok(map.source === row); }); + test('works with empty row', { concurrency: true }, async () => { + const map = CSVNormalizer.toFieldMap([]); + deepStrictEqual(map.size, 0); + ok(!map.has('a')); + map.set('a', 1); + deepStrictEqual(map.size, 1); + ok(map.has('a')); + }); }); suite('CSVNormalizer.from', { concurrency: true }, () => { -- 2.47.3