1
1
/* eslint-disable max-len, strict */
2
- var common = require ( '../common' ) ;
3
- var assert = require ( 'assert' ) ;
2
+ const common = require ( '../common' ) ;
3
+ const assert = require ( 'assert' ) ;
4
4
5
5
common . globalCheck = false ;
6
6
common . refreshTmpDir ( ) ;
@@ -15,11 +15,11 @@ const prompt_npm = 'npm should be run outside of the ' +
15
15
'node repl, in your normal shell.\n' +
16
16
'(Press Control-D to exit.)\n' ;
17
17
const expect_npm = prompt_npm + prompt_unix ;
18
- var server_tcp , server_unix , client_tcp , client_unix , replServer ;
18
+ let server_tcp , server_unix , client_tcp , client_unix , replServer ;
19
19
20
20
21
21
// absolute path to test/fixtures/a.js
22
- var moduleFilename = require ( 'path' ) . join ( common . fixturesDir , 'a' ) ;
22
+ const moduleFilename = require ( 'path' ) . join ( common . fixturesDir , 'a' ) ;
23
23
24
24
console . error ( 'repl test' ) ;
25
25
@@ -30,7 +30,7 @@ global.invoke_me = function(arg) {
30
30
31
31
function send_expect ( list ) {
32
32
if ( list . length > 0 ) {
33
- var cur = list . shift ( ) ;
33
+ const cur = list . shift ( ) ;
34
34
35
35
console . error ( 'sending ' + JSON . stringify ( cur . send ) ) ;
36
36
@@ -56,8 +56,8 @@ function strict_mode_error_test() {
56
56
57
57
function error_test ( ) {
58
58
// The other stuff is done so reuse unix socket
59
- var read_buffer = '' ;
60
- var run_strict_test = true ;
59
+ let read_buffer = '' ;
60
+ let run_strict_test = true ;
61
61
client_unix . removeAllListeners ( 'data' ) ;
62
62
63
63
client_unix . on ( 'data' , function ( data ) {
@@ -70,7 +70,7 @@ function error_test() {
70
70
if ( read_buffer . indexOf ( prompt_unix ) !== - 1 ) {
71
71
// if it's an exact match, then don't do the regexp
72
72
if ( read_buffer !== client_unix . expect ) {
73
- var expect = client_unix . expect ;
73
+ let expect = client_unix . expect ;
74
74
if ( expect === prompt_multiline )
75
75
expect = / [ \. ] { 3 } / ;
76
76
assert . ok ( read_buffer . match ( expect ) ) ;
@@ -354,13 +354,13 @@ function tcp_test() {
354
354
} ) ;
355
355
356
356
server_tcp . listen ( 0 , function ( ) {
357
- var read_buffer = '' ;
357
+ let read_buffer = '' ;
358
358
359
359
client_tcp = net . createConnection ( this . address ( ) . port ) ;
360
360
361
361
client_tcp . on ( 'connect' , function ( ) {
362
- assert . equal ( true , client_tcp . readable ) ;
363
- assert . equal ( true , client_tcp . writable ) ;
362
+ assert . strictEqual ( true , client_tcp . readable ) ;
363
+ assert . strictEqual ( true , client_tcp . writable ) ;
364
364
365
365
send_expect ( [
366
366
{ client : client_tcp , send : '' ,
@@ -423,13 +423,13 @@ function unix_test() {
423
423
} ) ;
424
424
425
425
server_unix . on ( 'listening' , function ( ) {
426
- var read_buffer = '' ;
426
+ let read_buffer = '' ;
427
427
428
428
client_unix = net . createConnection ( common . PIPE ) ;
429
429
430
430
client_unix . on ( 'connect' , function ( ) {
431
- assert . equal ( true , client_unix . readable ) ;
432
- assert . equal ( true , client_unix . writable ) ;
431
+ assert . strictEqual ( true , client_unix . readable ) ;
432
+ assert . strictEqual ( true , client_unix . writable ) ;
433
433
434
434
send_expect ( [
435
435
{ client : client_unix , send : '' ,
0 commit comments