]> git.ardis.lu - csvio/commitdiff
Add empty row test
authorArdis Lu <ardisglu@gmail.com>
Fri, 2 Jan 2026 04:21:39 +0000 (20:21 -0800)
committerArdis Lu <ardisglu@gmail.com>
Fri, 2 Jan 2026 04:21:39 +0000 (20:21 -0800)
test/normalization.test.js

index 268b52ed47e1c3cd76d39dbef783a83be020957b..a50332efbef43fb0894feee474bde445bf7cc7ee 100644 (file)
@@ -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 }, () => {
This page took 0.036196 seconds and 4 git commands to generate.