@@ -15,7 +15,7 @@ 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 , timer ;
18
+ var server_tcp , server_unix , client_tcp , client_unix , timer , replServer ;
19
19
20
20
21
21
// absolute path to test/fixtures/a.js
@@ -48,9 +48,17 @@ function clean_up() {
48
48
clearTimeout ( timer ) ;
49
49
}
50
50
51
+ function strict_mode_error_test ( ) {
52
+ send_expect ( [
53
+ { client : client_unix , send : 'ref = 1' ,
54
+ expect : / ^ R e f e r e n c e E r r o r : \s r e f \s i s \s n o t \s d e f i n e d \n \s + a t \s r e p l : 1 : 5 / } ,
55
+ ] ) ;
56
+ }
57
+
51
58
function error_test ( ) {
52
59
// The other stuff is done so reuse unix socket
53
60
var read_buffer = '' ;
61
+ var run_strict_test = true ;
54
62
client_unix . removeAllListeners ( 'data' ) ;
55
63
56
64
client_unix . on ( 'data' , function ( data ) {
@@ -72,6 +80,10 @@ function error_test() {
72
80
read_buffer = '' ;
73
81
if ( client_unix . list && client_unix . list . length > 0 ) {
74
82
send_expect ( client_unix . list ) ;
83
+ } else if ( run_strict_test ) {
84
+ replServer . replMode = repl . REPL_MODE_STRICT ;
85
+ run_strict_test = false ;
86
+ strict_mode_error_test ( ) ;
75
87
} else {
76
88
console . error ( 'End of Error test, running TCP test.' ) ;
77
89
tcp_test ( ) ;
@@ -83,6 +95,10 @@ function error_test() {
83
95
read_buffer = '' ;
84
96
if ( client_unix . list && client_unix . list . length > 0 ) {
85
97
send_expect ( client_unix . list ) ;
98
+ } else if ( run_strict_test ) {
99
+ replServer . replMode = repl . REPL_MODE_STRICT ;
100
+ run_strict_test = false ;
101
+ strict_mode_error_test ( ) ;
86
102
} else {
87
103
console . error ( 'End of Error test, running TCP test.\n' ) ;
88
104
tcp_test ( ) ;
@@ -381,12 +397,13 @@ function unix_test() {
381
397
socket . end ( ) ;
382
398
} ) ;
383
399
384
- repl . start ( {
400
+ replServer = repl . start ( {
385
401
prompt : prompt_unix ,
386
402
input : socket ,
387
403
output : socket ,
388
404
useGlobal : true
389
- } ) . context . message = message ;
405
+ } ) ;
406
+ replServer . context . message = message ;
390
407
} ) ;
391
408
392
409
server_unix . on ( 'listening' , function ( ) {
0 commit comments