Browse Source

Add test to check for empty field in the begining (#790)

pull/796/head
Demetris Manikas 5 years ago committed by GitHub
parent
commit
4edef1b267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      tests/test-cases.js

17
tests/test-cases.js

@ -732,6 +732,23 @@ var PARSE_TESTS = [
}] }]
} }
}, },
{
description: "Row with enough fields but blank field in the begining",
input: 'A,B,C\r\n,b1,c1\r\na2,b2,c2',
expected: {
data: [["A", "B", "C"], ['', 'b1', 'c1'], ['a2', 'b2', 'c2']],
errors: []
}
},
{
description: "Row with enough fields but blank field in the begining using headers",
input: 'A,B,C\r\n,b1,c1\r\n,b2,c2',
config: { header: true },
expected: {
data: [{"A": "", "B": "b1", "C": "c1"}, {"A": "", "B": "b2", "C": "c2"}],
errors: []
}
},
{ {
description: "Row with enough fields but blank field at end", description: "Row with enough fields but blank field at end",
input: 'A,B,C\r\na,b,', input: 'A,B,C\r\na,b,',

Loading…
Cancel
Save