1
1
'use strict' ;
2
- var common = require ( '../common' ) ;
3
- var assert = require ( 'assert' ) ;
4
- var Stream = require ( 'stream' ) ;
5
- var repl = require ( 'repl' ) ;
2
+ const common = require ( '../common' ) ;
3
+ const assert = require ( 'assert' ) ;
4
+ const Stream = require ( 'stream' ) ;
5
+ const repl = require ( 'repl' ) ;
6
6
7
7
common . globalCheck = false ;
8
8
9
- var tests = [
9
+ const tests = [
10
10
testSloppyMode ,
11
11
testStrictMode ,
12
12
testAutoMode
@@ -17,22 +17,22 @@ tests.forEach(function(test) {
17
17
} ) ;
18
18
19
19
function testSloppyMode ( ) {
20
- var cli = initRepl ( repl . REPL_MODE_SLOPPY ) ;
20
+ const cli = initRepl ( repl . REPL_MODE_SLOPPY ) ;
21
21
22
22
cli . input . emit ( 'data' , `
23
23
x = 3
24
24
` . trim ( ) + '\n' ) ;
25
- assert . equal ( cli . output . accumulator . join ( '' ) , '> 3\n> ' ) ;
25
+ assert . strictEqual ( cli . output . accumulator . join ( '' ) , '> 3\n> ' ) ;
26
26
cli . output . accumulator . length = 0 ;
27
27
28
28
cli . input . emit ( 'data' , `
29
29
let y = 3
30
30
` . trim ( ) + '\n' ) ;
31
- assert . equal ( cli . output . accumulator . join ( '' ) , 'undefined\n> ' ) ;
31
+ assert . strictEqual ( cli . output . accumulator . join ( '' ) , 'undefined\n> ' ) ;
32
32
}
33
33
34
34
function testStrictMode ( ) {
35
- var cli = initRepl ( repl . REPL_MODE_STRICT ) ;
35
+ const cli = initRepl ( repl . REPL_MODE_STRICT ) ;
36
36
37
37
cli . input . emit ( 'data' , `
38
38
x = 3
@@ -44,30 +44,30 @@ function testStrictMode() {
44
44
cli . input . emit ( 'data' , `
45
45
let y = 3
46
46
` . trim ( ) + '\n' ) ;
47
- assert . equal ( cli . output . accumulator . join ( '' ) , 'undefined\n> ' ) ;
47
+ assert . strictEqual ( cli . output . accumulator . join ( '' ) , 'undefined\n> ' ) ;
48
48
}
49
49
50
50
function testAutoMode ( ) {
51
- var cli = initRepl ( repl . REPL_MODE_MAGIC ) ;
51
+ const cli = initRepl ( repl . REPL_MODE_MAGIC ) ;
52
52
53
53
cli . input . emit ( 'data' , `
54
54
x = 3
55
55
` . trim ( ) + '\n' ) ;
56
- assert . equal ( cli . output . accumulator . join ( '' ) , '> 3\n> ' ) ;
56
+ assert . strictEqual ( cli . output . accumulator . join ( '' ) , '> 3\n> ' ) ;
57
57
cli . output . accumulator . length = 0 ;
58
58
59
59
cli . input . emit ( 'data' , `
60
60
let y = 3
61
61
` . trim ( ) + '\n' ) ;
62
- assert . equal ( cli . output . accumulator . join ( '' ) , 'undefined\n> ' ) ;
62
+ assert . strictEqual ( cli . output . accumulator . join ( '' ) , 'undefined\n> ' ) ;
63
63
}
64
64
65
65
function initRepl ( mode ) {
66
- var input = new Stream ( ) ;
66
+ const input = new Stream ( ) ;
67
67
input . write = input . pause = input . resume = function ( ) { } ;
68
68
input . readable = true ;
69
69
70
- var output = new Stream ( ) ;
70
+ const output = new Stream ( ) ;
71
71
output . write = output . pause = output . resume = function ( buf ) {
72
72
output . accumulator . push ( buf ) ;
73
73
} ;
0 commit comments