Skip to content

Commit bcbf50d

Browse files
outsiderisMylesBorins
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 00f0864 commit bcbf50d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use strict';
2-
varcommon=require('../common');
3-
varassert=require('assert');
2+
constcommon=require('../common');
3+
constassert=require('assert');
44

5-
varhttp=require('http');
5+
consthttp=require('http');
66

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

13-
varhost='*'.repeat(256);
13+
consthost='*'.repeat(256);
1414

1515
functiondo_not_call(){
1616
thrownewError('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-
varreq1=mod.get({host: host,port: 42},do_not_call);
23+
constreq1=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-
varreq2=mod.request({method: 'GET',host: host,port: 42},do_not_call);
29+
constreq2=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)