| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ common.globalCheck = false; | |||
| 25 | 25 | ||
| 26 | 26 | const assert = require('assert'); | |
| 27 | 27 | const repl = require('repl'); | |
| 28 | + const util = require('util'); | ||
| 28 | 29 | ||
| 29 | 30 | // Create a dummy stream that does nothing | |
| 30 | 31 | const dummy = new common.ArrayStream(); | |
@@ -38,11 +39,13 @@ function testReset(cb) { | |||
| 38 | 39 | r.context.foo = 42; | |
| 39 | 40 | r.on('reset', common.mustCall(function(context) { | |
| 40 | 41 | 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)}`); | ||
| 42 | 44 | assert.strictEqual( | |
| 43 | 45 | context.foo, | |
| 44 | 46 | 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.` | ||
| 46 | 49 | ); | |
| 47 | 50 | context.foo = 42; | |
| 48 | 51 | cb(); | |
@@ -61,7 +64,8 @@ function testResetGlobal() { | |||
| 61 | 64 | assert.strictEqual( | |
| 62 | 65 | context.foo, | |
| 63 | 66 | 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.` | ||
| 65 | 69 | ); | |
| 66 | 70 | })); | |
| 67 | 71 | r.resetContext(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments