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

supertest.post doesn't reach .end(callback) when Node's response.end is used #76

Closed
msafi opened this issue Sep 13, 2013 · 3 comments
Closed

Comments

@msafi
Copy link

msafi commented Sep 13, 2013

Wasted like 3 hours in spaghetti code trying to debug this and finally found the problem to be that my route handler ends the response with res.end(200). Changing that to res.send(200) seems to have fixed the problem and now I can reach the end(callback) method of supertest.

@gjohnson
Copy link
Contributor

I am unable to reproduce that behavior. Can you provide an example that reproduces the issue?

@msafi
Copy link
Author

msafi commented Sep 16, 2013

I must apologize for this. I tried to reproduce the issue in a new project, I couldn't. I went back to the original project where I encountered this but it's changed since, and I couldn't reproduce the bug there either. Apologize for wasting your time.

@gjohnson
Copy link
Contributor

It's all good. Perhaps at the time, the project was using domains in some strange way, that might have effected this since in node core, http.OutgoingMessage will throw if you attempt to write a non-string or buffer as you showed in your example.

https://github.com/joyent/node/blob/master/lib/_http_outgoing.js#L417

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

No branches or pull requests

2 participants