@@ -4,6 +4,7 @@ common.globalCheck = false;
44
55const assert = require ( 'assert' ) ;
66const repl = require ( 'repl' ) ;
7+ const util = require ( 'util' ) ;
78
89// Create a dummy stream that does nothing
910const dummy = new common . ArrayStream ( ) ;
@@ -17,11 +18,13 @@ function testReset(cb) {
1718 r . context . foo = 42 ;
1819 r . on ( 'reset' , common . mustCall ( function ( context ) {
1920 assert ( ! ! context , 'REPL did not emit a context with reset event' ) ;
20- assert . strictEqual ( context , r . context , 'REPL emitted incorrect context' ) ;
21+ assert . strictEqual ( context , r . context , 'REPL emitted incorrect context. ' +
22+ `context is ${ util . inspect ( context ) } , expected ${ util . inspect ( r . context ) } ` ) ;
2123 assert . strictEqual (
2224 context . foo ,
2325 undefined ,
24- 'REPL emitted the previous context, and is not using global as context'
26+ 'REPL emitted the previous context and is not using global as context. ' +
27+ `context.foo is ${ context . foo } , expected undefined.`
2528 ) ;
2629 context . foo = 42 ;
2730 cb ( ) ;
@@ -40,7 +43,8 @@ function testResetGlobal() {
4043 assert . strictEqual (
4144 context . foo ,
4245 42 ,
43- '"foo" property is missing from REPL using global as context'
46+ '"foo" property is different from REPL using global as context. ' +
47+ `context.foo is ${ context . foo } , expected 42.`
4448 ) ;
4549 } ) ) ;
4650 r . resetContext ( ) ;
0 commit comments