Skip to content

Commit

Permalink
test: fixup test-http-hostname-typechecking
Browse files Browse the repository at this point in the history
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: #12627
Ref: #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>
  • Loading branch information
addaleax committed Apr 27, 2017
1 parent f6b1eb2 commit 28f535a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-http-hostname-typechecking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

0 comments on commit 28f535a

Please sign in to comment.