diff options
author | Outsider <outsideris@gmail.com> | 2016-12-01 13:08:04 -0600 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-12-04 19:02:30 -0800 |
commit | ecf7bb70a50ce1f13b64e728e29f69226bc9cff6 (patch) | |
tree | fb0f56d45478b1b0f145f623e4233706f30e8299 /test/parallel/test-http-dns-error.js | |
parent | 1d6c2647ded12eb6364a9b1a6cf31854b63a9752 (diff) | |
download | node-new-ecf7bb70a50ce1f13b64e728e29f69226bc9cff6.tar.gz |
test: refactor test-http-dns-error
Replace var with const and use strictEqual().
PR-URL: https://github.com/nodejs/node/pull/10062
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Diffstat (limited to 'test/parallel/test-http-dns-error.js')
-rw-r--r-- | test/parallel/test-http-dns-error.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js index f1f144a60a..5e15ab9a3f 100644 --- a/test/parallel/test-http-dns-error.js +++ b/test/parallel/test-http-dns-error.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var http = require('http'); +const http = require('http'); if (common.hasCrypto) { var https = require('https'); @@ -10,7 +10,7 @@ if (common.hasCrypto) { common.skip('missing crypto'); } -var host = '*'.repeat(256); +const host = '*'.repeat(256); function do_not_call() { throw new Error('This function should not have been called.'); @@ -20,15 +20,15 @@ function test(mod) { // Bad host name should not throw an uncatchable exception. // Ensure that there is time to attach an error listener. - var req1 = mod.get({host: host, port: 42}, do_not_call); + const req1 = mod.get({host: host, port: 42}, do_not_call); req1.on('error', common.mustCall(function(err) { - assert.equal(err.code, 'ENOTFOUND'); + assert.strictEqual(err.code, 'ENOTFOUND'); })); // http.get() called req1.end() for us - var req2 = mod.request({method: 'GET', host: host, port: 42}, do_not_call); + const req2 = mod.request({method: 'GET', host: host, port: 42}, do_not_call); req2.on('error', common.mustCall(function(err) { - assert.equal(err.code, 'ENOTFOUND'); + assert.strictEqual(err.code, 'ENOTFOUND'); })); req2.end(); } |