diff options
author | Rich Trott <rtrott@gmail.com> | 2016-01-30 20:43:11 -0800 |
---|---|---|
committer | Roman Klauke <romaaan.git@gmail.com> | 2016-02-01 20:05:04 +0100 |
commit | 463aa196cc7f14aa7bedbadbc33f86a625f428ad (patch) | |
tree | 20c45bb66be9589207b2a6840f076c4f8fc566ff /test/parallel/test-http-dns-error.js | |
parent | 754bcff73ee06553f4183fd7871cf97e40e7b084 (diff) | |
download | android-node-v8-463aa196cc7f14aa7bedbadbc33f86a625f428ad.tar.gz android-node-v8-463aa196cc7f14aa7bedbadbc33f86a625f428ad.tar.bz2 android-node-v8-463aa196cc7f14aa7bedbadbc33f86a625f428ad.zip |
test: fix redeclared test-http-* vars
PR-URL: https://github.com/nodejs/node/pull/4987
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Diffstat (limited to 'test/parallel/test-http-dns-error.js')
-rw-r--r-- | test/parallel/test-http-dns-error.js | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js index 55195e45b7..ad360f5b4d 100644 --- a/test/parallel/test-http-dns-error.js +++ b/test/parallel/test-http-dns-error.js @@ -10,9 +10,6 @@ if (common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); } -var expected_bad_requests = 0; -var actual_bad_requests = 0; - var host = '********'; host += host; host += host; @@ -25,23 +22,20 @@ function do_not_call() { } function test(mod) { - expected_bad_requests += 2; // Bad host name should not throw an uncatchable exception. // Ensure that there is time to attach an error listener. - var req = mod.get({host: host, port: 42}, do_not_call); - req.on('error', function(err) { + var req1 = mod.get({host: host, port: 42}, do_not_call); + req1.on('error', common.mustCall(function(err) { assert.equal(err.code, 'ENOTFOUND'); - actual_bad_requests++; - }); - // http.get() called req.end() for us + })); + // http.get() called req1.end() for us - var req = mod.request({method: 'GET', host: host, port: 42}, do_not_call); - req.on('error', function(err) { + var req2 = mod.request({method: 'GET', host: host, port: 42}, do_not_call); + req2.on('error', common.mustCall(function(err) { assert.equal(err.code, 'ENOTFOUND'); - actual_bad_requests++; - }); - req.end(); + })); + req2.end(); } if (common.hasCrypto) { @@ -51,7 +45,3 @@ if (common.hasCrypto) { } test(http); - -process.on('exit', function() { - assert.equal(actual_bad_requests, expected_bad_requests); -}); |