@@ -7,6 +7,7 @@ const stream = require('stream');
77const REPL = require ( 'internal/repl' ) ;
88const assert = require ( 'assert' ) ;
99const inspect = require ( 'util' ) . inspect ;
10+ const { REPL_MODE_SLOPPY , REPL_MODE_STRICT } = require ( 'repl' ) ;
1011
1112const tests = [
1213 {
@@ -33,6 +34,14 @@ const tests = [
3334 env : { NODE_NO_READLINE : '0' } ,
3435 expected : { terminal : true , useColors : true }
3536 } ,
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+ } ,
3645] ;
3746
3847function run ( test ) {
@@ -54,6 +63,8 @@ function run(test) {
5463 `Expected ${ inspect ( expected ) } with ${ inspect ( env ) } ` ) ;
5564 assert . strictEqual ( repl . useColors , expected . useColors ,
5665 `Expected ${ inspect ( expected ) } with ${ inspect ( env ) } ` ) ;
66+ assert . strictEqual ( repl . replMode , expected . replMode || REPL_MODE_SLOPPY ,
67+ `Expected ${ inspect ( expected ) } with ${ inspect ( env ) } ` ) ;
5768 for ( const key of Object . keys ( env ) ) {
5869 delete process . env [ key ] ;
5970 }
0 commit comments