-
Notifications
You must be signed in to change notification settings - Fork 30k
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
test: clean tls-connect-given-socket #8616
test: clean tls-connect-given-socket #8616
Conversation
Changed vars to consts and lets, assert.equals to assert.strictEquals and added common.mustCall around a connect callback
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
|
||
function next() { | ||
// Already connected socket | ||
var connected = net.connect(server.address().port, function() { | ||
const connected = net.connect(server.address().port, function() { | ||
establish(connected); | ||
}); |
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/should this function get a common.mustCall
, too?
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.
Yes
rejectUnauthorized: false, | ||
socket: socket | ||
}, function() { | ||
clientConnected++; | ||
var data = ''; | ||
let data = ''; | ||
client.on('data', function(chunk) { | ||
data += chunk.toString(); | ||
}); | ||
client.on('end', function() { |
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.
common.mustCall()
?
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.
Yes actually (35 & 38)
Changed vars to consts and lets, assert.equals to assert.strictEquals and added common.mustCall around a connect callback
Added more common.mustCalls, switched to arrow functions
Merge branch 'clean-test-tls-connect-given-socket' of github.com:thomasvanlankveld/node into clean-test-tls-connect-given-socket
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 with green CI
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
@addaleax are you satisfied with the changes? Looks like your review suggestions have been addressed. |
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.
Yes, LGTM!
Also, I generally trust collaborators here to be able to tell whether my requested changes have been made – I appreciate the ping, but you don’t need to wait for me or anything.
}); | ||
assert(client.readable); | ||
assert(client.writable); | ||
|
||
return client; | ||
} | ||
|
||
const { port } = server.address(); |
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.
Nice trick, I should think of that the next time I do this.
I'll start landing this:
|
Changed vars to consts and lets, assert.equals to assert.strictEquals and added common.mustCall around callbacks. Switched to arrow functions. PR-URL: nodejs#8616 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
landed in 80620d8 Thank you for your contribution, @thomasvanlankveld |
Changed vars to consts and lets, assert.equals to assert.strictEquals and added common.mustCall around callbacks. Switched to arrow functions. PR-URL: #8616 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesDescription of change
Changed vars to consts and lets, assert.equals to assert.strictEquals and added
common.mustCall around a connect callback