From 229af7049775aaf5830ecd2f160d65275b953624 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 6 Feb 2017 16:43:23 +0100 Subject: [PATCH] Add test case for headers with preceding comments As described in #351 --- tests/test-cases.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test-cases.js b/tests/test-cases.js index e31571c..81f3d53 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -910,6 +910,16 @@ var PARSE_TESTS = [ data: [['a', 'b', 'c,d']], errors: [] } + }, + { + description: "Header row with preceding comment", + notes: "Must parse correctly headers if they are preceded by comments", + input: '#Comment\na,b\nc,d\n', + config: { header: true, comments: '#', skipEmptyLines: true, delimiter: ','}, + expected: { + data: [{'a': 'c', 'b': 'd'}], + errors: [] + } } ];