Skip to content

Commit

Permalink
Add test to check for empty field in the begining (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
demetris-manikas authored May 1, 2020
1 parent 4b192de commit 4edef1b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
input: 'A,B,C\r\na,b,',
Expand Down

0 comments on commit 4edef1b

Please sign in to comment.