Browse Source

test: fixup test-http-hostname-typechecking

This test would currently create HTTP requests to localhost:80
and would time out on machines that actually had an server listening
there.

To address that, `end()` the requests that are generated.

PR-URL: https://github.com/nodejs/node/pull/12627
Ref: https://github.com/nodejs/node/pull/12494
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
Anna Henningsen 8 years ago
parent
commit
28f535a923
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 4
      test/parallel/test-http-hostname-typechecking.js

4
test/parallel/test-http-hostname-typechecking.js

@ -21,7 +21,7 @@ vals.forEach((v) => {
// These values are OK and should not throw synchronously
['', undefined, null].forEach((v) => {
assert.doesNotThrow(() => {
http.request({hostname: v}).on('error', common.noop);
http.request({host: v}).on('error', common.noop);
http.request({hostname: v}).on('error', common.noop).end();
http.request({host: v}).on('error', common.noop).end();
});
});

Loading…
Cancel
Save