@@ -7,6 +7,7 @@ const stream = require('stream');
7
7
const REPL = require ( 'internal/repl' ) ;
8
8
const assert = require ( 'assert' ) ;
9
9
const inspect = require ( 'util' ) . inspect ;
10
+ const { REPL_MODE_SLOPPY , REPL_MODE_STRICT } = require ( 'repl' ) ;
10
11
11
12
const tests = [
12
13
{
@@ -33,6 +34,14 @@ const tests = [
33
34
env : { NODE_NO_READLINE : '0' } ,
34
35
expected : { terminal : true , useColors : true }
35
36
} ,
37
+ {
38
+ env : { NODE_REPL_MODE : 'sloppy' } ,
39
+ expected : { terminal : true , useColors : true , replMode : REPL_MODE_SLOPPY }
40
+ } ,
41
+ {
42
+ env : { NODE_REPL_MODE : 'strict' } ,
43
+ expected : { terminal : true , useColors : true , replMode : REPL_MODE_STRICT }
44
+ } ,
36
45
] ;
37
46
38
47
function run ( test ) {
@@ -54,6 +63,8 @@ function run(test) {
54
63
`Expected ${ inspect ( expected ) } with ${ inspect ( env ) } ` ) ;
55
64
assert . strictEqual ( repl . useColors , expected . useColors ,
56
65
`Expected ${ inspect ( expected ) } with ${ inspect ( env ) } ` ) ;
66
+ assert . strictEqual ( repl . replMode , expected . replMode || REPL_MODE_SLOPPY ,
67
+ `Expected ${ inspect ( expected ) } with ${ inspect ( env ) } ` ) ;
57
68
for ( const key of Object . keys ( env ) ) {
58
69
delete process . env [ key ] ;
59
70
}
0 commit comments