@@ -25,6 +25,7 @@ common.globalCheck = false;
2525
2626const assert = require('assert');
2727const repl = require('repl');
28+ const util = require('util');
2829
2930// Create a dummy stream that does nothing
3031const dummy = new common.ArrayStream();
@@ -38,11 +39,13 @@ function testReset(cb) {
3839 r.context.foo = 42;
3940 r.on('reset', common.mustCall(function(context) {
4041 assert(!!context, 'REPL did not emit a context with reset event');
41- assert.strictEqual(context, r.context, 'REPL emitted incorrect context');
42+ assert.strictEqual(context, r.context, 'REPL emitted incorrect context. ' +
43+ `context is ${util.inspect(context)}, expected ${util.inspect(r.context)}`);
4244 assert.strictEqual(
4345 context.foo,
4446 undefined,
45- 'REPL emitted the previous context, and is not using global as context'
47+ 'REPL emitted the previous context and is not using global as context. ' +
48+ `context.foo is ${context.foo}, expected undefined.`
4649 );
4750 context.foo = 42;
4851 cb();
@@ -61,7 +64,8 @@ function testResetGlobal() {
6164 assert.strictEqual(
6265 context.foo,
6366 42,
64- '"foo" property is missing from REPL using global as context'
67+ '"foo" property is different from REPL using global as context. ' +
68+ `context.foo is ${context.foo}, expected 42.`
6569 );
6670 }));
6771 r.resetContext();
0 commit comments