From 0707a6b2b5a6ca54eb83aa26f56b7aeed519eca2 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 29 Jun 2017 16:21:23 -0700 Subject: [PATCH] test: refactor test-http-hostname-typechecking * Use common.mustCall() to confirm callback is invoked. * Change spacing of require statements to conform to test-writing guide. PR-URL: https://github.com/nodejs/node/pull/13993 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/parallel/test-http-hostname-typechecking.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-http-hostname-typechecking.js b/test/parallel/test-http-hostname-typechecking.js index c3b702896d4e39..d1a407cf28dcae 100644 --- a/test/parallel/test-http-hostname-typechecking.js +++ b/test/parallel/test-http-hostname-typechecking.js @@ -1,6 +1,6 @@ 'use strict'; - const common = require('../common'); + const assert = require('assert'); const http = require('http'); @@ -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(); }); });