Skip to content

Commit

Permalink
test: refactor test-http-hostname-typechecking
Browse files Browse the repository at this point in the history
* Use common.mustCall() to confirm callback is invoked.
* Change spacing of require statements to conform to test-writing guide.

PR-URL: #13993
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and addaleax committed Jul 18, 2017
1 parent 534ae44 commit 0707a6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-http-hostname-typechecking.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const common = require('../common');

const assert = require('assert');
const http = require('http');

Expand All @@ -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).end();
http.request({host: v}).on('error', common.noop).end();
http.request({hostname: v}).on('error', common.mustCall()).end();
http.request({host: v}).on('error', common.mustCall()).end();
});
});

0 comments on commit 0707a6b

Please sign in to comment.