You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Giving a wrong endpoint right now for an integration test will exceed the 2 seconds time that mocha uses by default. I guess the server takes longer than two seconds to time out, so the test has no time to fail. Play with the default time, figure out what happens when the server times out, and make changes to the test (or test suite) accordingly.
The text was updated successfully, but these errors were encountered:
@josmas if I'm serving on port 8000 I'm seeing at least 5 different error cases during npm test for malformed endpoints, but none of them are timeouts:
if I change the BADGR_API_ENDPOINT to something like http://localhost:8001 (or wrongly specify https) then I get Error: connect ECONNREFUSED 127.0.0.1:8001 (or ...443)
if I change it to localhost:8000 (without http) I get Error: Invalid protocol: localhost:
If I change it to http://localhost:8000/foo or http://www.google.com/ then I get SyntaxError: Unexpected token <
if I change it to http://www.google.com (lacking the trailing slash) then I get Error: getaddrinfo ENOTFOUND www.google.comapi-auth www.google.comapi-auth:80
Any of these could be caught by testing, but I'm wondering why I can't replicate the timeout error you're seeing?
mmm, this is odd. I believe it was just passing a well formed URI but not the right one, like your first example. It is not timing out anymore. May be the habitat changes, although I can't think of how that may be affecting. It's the only thing that is different (as far as I can think rn).
Giving a wrong endpoint right now for an integration test will exceed the 2 seconds time that mocha uses by default. I guess the server takes longer than two seconds to time out, so the test has no time to fail. Play with the default time, figure out what happens when the server times out, and make changes to the test (or test suite) accordingly.
The text was updated successfully, but these errors were encountered: