diff --git a/test/parseCsv.spec.js b/test/parseCsv.spec.js index 73ba810..66a9262 100644 --- a/test/parseCsv.spec.js +++ b/test/parseCsv.spec.js @@ -30,7 +30,9 @@ describe('handler/parseCsv.js', function() { it('should fail if malformed CSV data is provided', function(done) { - handler.process({data: dataJson}) + // An unclosed quote should throw an error when processed by csv-parse. + const badData = '"test test\t'; + handler.process({data: badData}) .catch(function(err) { assert.ok(err, 'failure reported for malformed CSV data'); done(); diff --git a/test/parseSpaces.spec.js b/test/parseSpaces.spec.js index 3017679..fa0ee28 100644 --- a/test/parseSpaces.spec.js +++ b/test/parseSpaces.spec.js @@ -43,7 +43,9 @@ describe('handler/parseSpaces.js', function() { it('should fail if malformed space separated data is provided', function(done) { - handler.process({data: dataJson}) + // An unclosed quote should throw an error when processed by csv-parse. + const badData = '"test test'; + handler.process({data: badData}) .catch(function(err) { assert.ok(err, 'failure reported for malformed space separated data'); diff --git a/test/parseTabs.spec.js b/test/parseTabs.spec.js index 8d5e5d1..a25fc3f 100644 --- a/test/parseTabs.spec.js +++ b/test/parseTabs.spec.js @@ -30,7 +30,9 @@ describe('handler/parseTabs.js', function() { it('should fail if malformed tab separated data is provided', function(done) { - handler.process({data: dataJson}) + // An unclosed quote should throw an error when processed by csv-parse. + const badData = '"test test\t'; + handler.process({data: badData}) .catch(function(err) { assert.ok(err, 'failure reported for malformed tab separated data'); done();