Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: better wording on assertion errors
  • Loading branch information
AdriVanHoudt committed Nov 6, 2017
commit e1bbaf64958d21c6673148b9e56f3cf62808c88e
7 changes: 4 additions & 3 deletions test/parallel/test-repl-reset-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ common.globalCheck = false;

const assert = require('assert');
const repl = require('repl');
const util = require('util');

// Create a dummy stream that does nothing
const dummy = new common.ArrayStream();
Expand All @@ -38,11 +39,11 @@ function testReset(cb) {
r.context.foo = 42;
r.on('reset', common.mustCall(function(context) {
assert(!!context, 'REPL did not emit a context with reset event');
assert.strictEqual(context, r.context, 'REPL emitted incorrect context');
assert.strictEqual(context, r.context, `REPL emitted incorrect context. context is ${util.inspect(context)}, expected ${util.inspect(r.context)}`);
assert.strictEqual(
context.foo,
undefined,
'REPL emitted the previous context, and is not using global as context'
`REPL emitted the previous context, and is not using global as context. context.foo is ${context.foo}, expected undefined.`
);
context.foo = 42;
cb();
Expand All @@ -61,7 +62,7 @@ function testResetGlobal() {
assert.strictEqual(
context.foo,
42,
'"foo" property is missing from REPL using global as context'
`"foo" property is missing or different from REPL using global as context. context.foo is ${context.foo}, expected 42.`
);
}));
r.resetContext();
Expand Down