| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Can you line this up with the previous line.
Sorry, something went wrong.
|
Ping @courtnek: Thanks for the work on this! Can you make the change requested by @cjihrig and push it to this branch? If you want, you can copy/paste this into the file: 'use strict';
const common = require('../common');
common.globalCheck = false;
const assert = require('assert');
const repl = require('repl');
// Create a dummy stream that does nothing
const dummy = new common.ArrayStream();
function testReset(cb) {
const r = repl.start({
input: dummy,
output: dummy,
useGlobal: false
});
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.foo,
undefined,
'REPL emitted the previous context, and is not using global as context'
);
context.foo = 42;
cb();
}));
r.resetContext();
}
function testResetGlobal() {
const r = repl.start({
input: dummy,
output: dummy,
useGlobal: true
});
r.context.foo = 42;
r.on('reset', common.mustCall(function(context) {
assert.strictEqual(
context.foo,
42,
'"foo" property is missing from REPL using global as context'
);
}));
r.resetContext();
}
testReset(common.mustCall(testResetGlobal)); |
Sorry, something went wrong.
|
Sorry for the delay! Yeah @Trott I like breaking up the function args over multiple lines over splitting the string. I amended my commit with the new style. Let me know if there is anything else I can do. |
Sorry, something went wrong.
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout
|
CI: https://ci.nodejs.org/job/node-test-pull-request/5519/ @cjihrig Looks like your comment has been addressed. Looks good to you now? |
Sorry, something went wrong.
|
CI is ✅ |
Sorry, something went wrong.
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
Thanks for the contribution, @courtnek! 🎉 |
Sorry, something went wrong.
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
Description of change