Fix tests: call end on response, not result of writeHead#543
Fix tests: call end on response, not result of writeHead#543candrews wants to merge 1 commit intosockjs:mainfrom
Conversation
|
The failing test is because the test doesn't have access to Travis secure variables: Line 7 in ddae5a3 It would pass if run by the main sockjs-client repo. |
|
@brycekahle can you please take a look at this PR? |
| } else { | ||
| serve(req, res, function(err) { | ||
| var status = err ? err.statusCode : 404; | ||
| return res.writeHead(status).end(); |
There was a problem hiding this comment.
res.writeHead returns http.ServerResponse, so the previous code should be OK. The docs even say:
Returns a reference to the ServerResponse, so that calls can be chained.
There was a problem hiding this comment.
should be... but in reality, the test doesn't pass without the change from this PR.
Have you tried?
There was a problem hiding this comment.
Which specific test(s) are you referring to?
There was a problem hiding this comment.
Here's an example from #534
https://travis-ci.org/github/sockjs/sockjs-client/jobs/761021386#L416
And another from #536
https://travis-ci.org/github/sockjs/sockjs-client/jobs/762011841#L431
If you look the builds for some PRs, there are a number of examples.
No description provided.