Skip to content

Commit

Permalink
Test(errors): Added error tests
Browse files Browse the repository at this point in the history
* Error - cannot detect line format
* Error - invalid file
  • Loading branch information
fvdm committed Dec 6, 2017
1 parent b240a81 commit 32f4e22
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test.js
Expand Up @@ -116,4 +116,24 @@ dotest.add ('Semi-single-quoted - custom head', test => {
});


dotest.add ('Error - invalid file', test => {
app ('./invalid.file', (err, data) => {
test()
.isError ('fail', 'err', err)
.isUndefined ('fail', 'data', data)
.done();
});
});

dotest.add ('Error - cannot detect line format', test => {
app ('./test/test.invalid-line-format.csv', (err, data) => {
test()
.isError ('fail', 'err', err)
.isExactly ('fail', 'err.message', err && err.message, 'cannot detect line format')
.isUndefined ('fail', 'data', data)
.done();
});
});


dotest.run ();
1 change: 1 addition & 0 deletions test/test.invalid-line-format.csv
@@ -0,0 +1 @@
one,two

0 comments on commit 32f4e22

Please sign in to comment.