@@ -4,6 +4,7 @@ common.globalCheck = false;
4
4
5
5
const assert = require ( 'assert' ) ;
6
6
const repl = require ( 'repl' ) ;
7
+ const util = require ( 'util' ) ;
7
8
8
9
// Create a dummy stream that does nothing
9
10
const dummy = new common . ArrayStream ( ) ;
@@ -17,11 +18,13 @@ function testReset(cb) {
17
18
r . context . foo = 42 ;
18
19
r . on ( 'reset' , common . mustCall ( function ( context ) {
19
20
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 ) } ` ) ;
21
23
assert . strictEqual (
22
24
context . foo ,
23
25
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.`
25
28
) ;
26
29
context . foo = 42 ;
27
30
cb ( ) ;
@@ -40,7 +43,8 @@ function testResetGlobal() {
40
43
assert . strictEqual (
41
44
context . foo ,
42
45
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.`
44
48
) ;
45
49
} ) ) ;
46
50
r . resetContext ( ) ;
0 commit comments