Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
test: clean up repl-reset-event file#9931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you line this up with the previous line.
Trott commented Dec 10, 2016
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';constcommon=require('../common');common.globalCheck=false;constassert=require('assert');constrepl=require('repl');// Create a dummy stream that does nothingconstdummy=newcommon.ArrayStream();functiontestReset(cb){constr=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();}functiontestResetGlobal(){constr=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)); |
courtnek commented Dec 10, 2016
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout
Trott commented Dec 21, 2016
CI: https://ci.nodejs.org/job/node-test-pull-request/5519/ @cjihrig Looks like your comment has been addressed. Looks good to you now? |
Trott commented Dec 22, 2016
CI is ✅ |
jasnell commented Dec 24, 2016
ping @cjihrig |
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
jasnell commented Dec 24, 2016
Landed in e81e031 |
Trott commented Dec 24, 2016
Thanks for the contribution, @courtnek! 🎉 |
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
* Change vars to let/const * Add mustCall * equal -> strictEqual * remove timeout PR-URL: #9931 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
Description of change