diff --git a/papaparse.js b/papaparse.js index 0b15bfc..6f18efe 100755 --- a/papaparse.js +++ b/papaparse.js @@ -1707,7 +1707,7 @@ License: MIT for (var i = 0; i < msg.results.data.length; i++) { worker.userStep({ - data: [msg.results.data[i]], + data: msg.results.data[i], errors: msg.results.errors, meta: msg.results.meta }, handle); diff --git a/tests/test-cases.js b/tests/test-cases.js index 1dceaa3..e8b424f 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -1789,6 +1789,37 @@ var CUSTOM_TESTS = [ }); } }, + { + description: "Data is correctly parsed with steps", + expected: [['A', 'b', 'c'], ['d', 'E', 'f']], + run: function(callback) { + var data = []; + Papa.parse('A,b,c\nd,E,f', { + step: function(results) { + data.push(results.data); + }, + complete: function() { + callback(data); + } + }); + } + }, + { + description: "Data is correctly parsed with steps and worker", + expected: [['A', 'b', 'c'], ['d', 'E', 'f']], + run: function(callback) { + var data = []; + Papa.parse('A,b,c\nd,E,f', { + worker: true, + step: function(results) { + data.push(results.data); + }, + complete: function() { + callback(data); + } + }); + } + }, { description: "Step is called with the contents of the row", expected: ['A', 'b', 'c'],