Skip to content

Commit 5f3f54d

Browse files
outsiderisFishrock123
authored andcommitted
test: refactor test-http-dns-error
Replace var with const and use strictEqual(). PR-URL: #10062 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent ae2bf0a commit 5f3f54d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/parallel/test-http-dns-error.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

5-
var http = require('http');
5+
const http = require('http');
66

77
if (common.hasCrypto) {
88
var https = require('https');
99
} else {
1010
common.skip('missing crypto');
1111
}
1212

13-
var host = '*'.repeat(256);
13+
const host = '*'.repeat(256);
1414

1515
function do_not_call() {
1616
throw new Error('This function should not have been called.');
@@ -20,15 +20,15 @@ function test(mod) {
2020

2121
// Bad host name should not throw an uncatchable exception.
2222
// Ensure that there is time to attach an error listener.
23-
var req1 = mod.get({host: host, port: 42}, do_not_call);
23+
const req1 = mod.get({host: host, port: 42}, do_not_call);
2424
req1.on('error', common.mustCall(function(err) {
25-
assert.equal(err.code, 'ENOTFOUND');
25+
assert.strictEqual(err.code, 'ENOTFOUND');
2626
}));
2727
// http.get() called req1.end() for us
2828

29-
var req2 = mod.request({method: 'GET', host: host, port: 42}, do_not_call);
29+
const req2 = mod.request({method: 'GET', host: host, port: 42}, do_not_call);
3030
req2.on('error', common.mustCall(function(err) {
31-
assert.equal(err.code, 'ENOTFOUND');
31+
assert.strictEqual(err.code, 'ENOTFOUND');
3232
}));
3333
req2.end();
3434
}

0 commit comments

Comments
 (0)