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 gets exception if the HTTP server is down #237
Comments
It's been a while. Why this PR isn't getting merged? |
I am planning to try and get the 1.1.0 release out next week. |
I just tracked down this bug as well. We have a gulp task that starts our services and then runs functional tests. Due to a problem with our gulp task, the tests were running before the services finished starting. This was causing intermittent test failures with no clear reason for failure. Hoping this PR will expose the ECONNREFUSED error, which would have made debugging the problem much simpler. |
@mikelax I can still reproduce this error as of 1.1.0 - running tests against an offline server (or the wrong port on an active server) always results in a pass, even if explicit |
@csvan I will update the tag for this issue. It just recently got merged into master but it was not part of the 1.1.0 release. You can try to check out master and see if that works for you. |
Breaking changes should be 2.0, not 1.2. But this seems like a bug fix, not something that's going to break actual uses. I may be wrong, but that's my gut-check. |
hi @mikelax sorry to chime in with the others, but it's also occurring on 1.2. Just did a fresh install from npm (1.2) and have the same non-descriptive error message. The other issue, is that all the tests pass. Tried running from master and get the same message as well. Any ideas or help needed? There's another ticket open for the same issue - #314 |
Is there a workaround for this bug? All I get is the line Unlike the author of this thread, my server is definitely running. My code is:
|
I am also still getting this issue. Tried a few node versions within 6, 7, and 8. For me it happens only when I attach two files to my supertest POST request |
We have a REST API to reboot the HTTP server and then poll for it using another REST API to come back. While calling a REST API when web server is down, supertest gets an exception. You can see at the specific line that "res" is undefined because HTTP server is down. I think this code on line 202 needs to be modified to deal with this situation.
/home/psingh/applianceUpgrade/node_modules/supertest/lib/test.js:202
if (res.status !== status) {
^
TypeError: Cannot read property 'status' of undefined
at Test.assert (/home/psingh/applianceUpgrade/node_modules/supertest/lib/test.js:202:12)
The text was updated successfully, but these errors were encountered: