Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing errors were not being thrown correctly #77

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

AdrianoFerrari
Copy link
Member

Errors were only being thrown when present in the first and only line of the file. This was a critical issue, because it meant that an error in any multi-line file would fail to load, without any errors. In fact, the promise would neither reject or resolve.

(a note on Travis CI tests: http tests are failing simply because the tests were written for CouchDB 1.x, but fail on 2.x . seq is no longer a number, but a string, for instance).

Previously, the load promise would only be rejected if there was an
error in the *first* line of the file. Because in the tests there
was only one line, this wasn't picked up. Now errors from ndjson
are thrown correctly.
Tests were testing only the type 'error' but not the error message.
Chai's "should.be.a" takes two parameters: the type expected, and a
message to display if the types don't match. The second parameter
is *not* the expected error message.
@AdrianoFerrari
Copy link
Member Author

@oliviertassinari can you have a quick look at this?

There seems to have been an issue with the original changes you implemented. (you can see that it didn't throw an error if you passed in "foo\nbar" instead of just "foo" into the test).

I'd like another set of eyes on this before I contact nolan to try to get this merged.

@oliviertassinari
Copy link
Contributor

@AdrianoFerrari This was a long time ago. I have lost the context, sorry.

@AdrianoFerrari
Copy link
Member Author

Understood, thanks anyway 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants