Parsing errors were not being thrown correctly#77
Open
AdrianoFerrari wants to merge 7 commits intopouchdb-community:masterfrom
Open
Parsing errors were not being thrown correctly#77AdrianoFerrari wants to merge 7 commits intopouchdb-community:masterfrom
AdrianoFerrari wants to merge 7 commits intopouchdb-community:masterfrom
Conversation
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.
This reverts commit 54e967e.
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. |
Contributor
|
@AdrianoFerrari This was a long time ago. I have lost the context, sorry. |
Member
Author
|
Understood, thanks anyway 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 .
seqis no longer a number, but a string, for instance).