1
1
'use strict' ;
2
- var common = require ( '../common' ) ;
3
- var assert = require ( 'assert' ) ;
2
+ const common = require ( '../common' ) ;
3
+ const assert = require ( 'assert' ) ;
4
4
5
- var http = require ( 'http' ) ;
5
+ const http = require ( 'http' ) ;
6
6
7
7
if ( common . hasCrypto ) {
8
8
var https = require ( 'https' ) ;
9
9
} else {
10
10
common . skip ( 'missing crypto' ) ;
11
11
}
12
12
13
- var host = '*' . repeat ( 256 ) ;
13
+ const host = '*' . repeat ( 256 ) ;
14
14
15
15
function do_not_call ( ) {
16
16
throw new Error ( 'This function should not have been called.' ) ;
@@ -20,15 +20,15 @@ function test(mod) {
20
20
21
21
// Bad host name should not throw an uncatchable exception.
22
22
// 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 ) ;
24
24
req1 . on ( 'error' , common . mustCall ( function ( err ) {
25
- assert . equal ( err . code , 'ENOTFOUND' ) ;
25
+ assert . strictEqual ( err . code , 'ENOTFOUND' ) ;
26
26
} ) ) ;
27
27
// http.get() called req1.end() for us
28
28
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 ) ;
30
30
req2 . on ( 'error' , common . mustCall ( function ( err ) {
31
- assert . equal ( err . code , 'ENOTFOUND' ) ;
31
+ assert . strictEqual ( err . code , 'ENOTFOUND' ) ;
32
32
} ) ) ;
33
33
req2 . end ( ) ;
34
34
}
0 commit comments