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.
I thought I should document what I've done and why.
In client integration tests, helper.client now automatically adds a handler to client.on 'error'. This means that connection problems and other unexpected errors get printed out. It also means that the tests don't crash out the moment they hit an incorrect SQL syntax. Next, I did the same thing to client.query. This enabled me to actually see what errors I was getting, which revealed that (no real surprise here) "Relation person did not exist".
It's then that I found the comment "Make sure you run the script create-test-tables". :) So, reading the documentation correctly would have saved me a lot of hassle.
After doing that, I finally had 25 != 26 like we discussed last night. I've left these changes to the tests in because I think it's easier for someone to debug when they start out this way. Oh yes, it also prints out the test names. Your mileage may vary :)
I changed the query to select name from person order by name, simply because I had some (SQL Server) code recently that assumed the order by, which broke after a year in production. Wasn't very funny...
So finally I got around to reproducing my issue, which it turns out was harder than I thought. The basic problem was that it broke eyes, which isn't very testable. Instead, I went for the fact that iterating through the columns and calling "length" doesn't agree. Of course, if you use Object instead of Array, there isn't a length property anyway, but I think it might also be possible to get confused if there actually was a column called 'length'.