-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
modified test-repl-persistent-history to use common.mustCall #12703
Conversation
@@ -212,7 +206,10 @@ function cleanupTmpFile() { | |||
|
|||
// Copy our fixture to the tmp directory | |||
fs.createReadStream(historyFixturePath) | |||
.pipe(fs.createWriteStream(historyPath)).on('unpipe', () => runTest()); | |||
.pipe(fs.createWriteStream(historyPath)).on('unpipe', runTest); |
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.
Could you leave this as it was please.
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.
I'll do so. I removed the function because this way runTest was accounting for an additional call. I thought it'd be an extra burden on the reader if he sees common.mustCall(runTest, numtests + 1) later on. Sorry, this was my first contribution on the git via NodeTodo, I am figuring out how to undo these changes as recommended.
.pipe(fs.createWriteStream(historyPath)).on('unpipe', () => runTest()); | ||
.pipe(fs.createWriteStream(historyPath)).on('unpipe', runTest); | ||
|
||
// redefine runTest function that uses common.mustCall (https://github.com/nodejs/node/tree/master/test#mustcallfn-expected) |
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.
This comment can be dropped.
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.
I seem to recall not having done this for some specific reason but now I'm not sure what it was if it was anything...
.pipe(fs.createWriteStream(historyPath)).on('unpipe', runTest); | ||
|
||
// redefine runTest function that uses common.mustCall (https://github.com/nodejs/node/tree/master/test#mustcallfn-expected) | ||
runTest = common.mustCall(runTest, numtests); |
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.
Could you please name the wrapped version something else and update the call points respectively?
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 please look at it now? Thank you. I hope it was Ok to --amend
this change?
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.
I hope it was Ok to --amend this change?
Yeah that's fine
9549df3
to
ef63593
Compare
This LGTM if CI is green. Ping @cjihrig @Fishrock123 |
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.
LGTM if CI is green
Landed in 6058c43, thanks for the PR! :) |
PR-URL: #12703 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs#12703 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #12703 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #12703 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)