diff --git a/.eslintrc.js b/.eslintrc.js index 3085f72..f63bc09 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,7 +42,7 @@ module.exports = { "consistent-this": "off", "curly": "off", "default-case": "error", - "dot-location": "off", + "dot-location": "error", "dot-notation": "error", "eol-last": "error", "eqeqeq": "error", diff --git a/tests/node-tests.js b/tests/node-tests.js index 410dbc9..98acc9b 100644 --- a/tests/node-tests.js +++ b/tests/node-tests.js @@ -61,32 +61,32 @@ describe('PapaParse', function() { it('piped streaming CSV should be correctly parsed', function(done) { var data = []; - fs.createReadStream(__dirname + '/long-sample.csv', 'utf8') - .pipe(Papa.parse(Papa.NODE_STREAM_INPUT)) - .on('data', function(item) { - data.push(item); - }) - .on('end', function() { - assert.deepEqual(data[0], [ - 'Grant', - 'Dyer', - 'Donec.elementum@orciluctuset.example', - '2013-11-23T02:30:31-08:00', - '2014-05-31T01:06:56-07:00', - 'Magna Ut Associates', - 'ljenkins' - ]); - assert.deepEqual(data[7], [ - 'Talon', - 'Salinas', - 'posuere.vulputate.lacus@Donecsollicitudin.example', - '2015-01-31T09:19:02-08:00', - '2014-12-17T04:59:18-08:00', - 'Aliquam Iaculis Incorporate', - 'Phasellus@Quisquetincidunt.example' - ]); - done(); - }); + var readStream = fs.createReadStream(__dirname + '/long-sample.csv', 'utf8'); + var csvStream = readStream.pipe(Papa.parse(Papa.NODE_STREAM_INPUT)); + csvStream.on('data', function(item) { + data.push(item); + }); + csvStream.on('end', function() { + assert.deepEqual(data[0], [ + 'Grant', + 'Dyer', + 'Donec.elementum@orciluctuset.example', + '2013-11-23T02:30:31-08:00', + '2014-05-31T01:06:56-07:00', + 'Magna Ut Associates', + 'ljenkins' + ]); + assert.deepEqual(data[7], [ + 'Talon', + 'Salinas', + 'posuere.vulputate.lacus@Donecsollicitudin.example', + '2015-01-31T09:19:02-08:00', + '2014-12-17T04:59:18-08:00', + 'Aliquam Iaculis Incorporate', + 'Phasellus@Quisquetincidunt.example' + ]); + done(); + }); }); it('should support pausing and resuming on same tick when streaming', function(done) {