-
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: improve code in test-crypto-verify #10845
Conversation
port: this.address().port, | ||
server.listen(0, () => { | ||
tls.connect( | ||
{ |
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 move this curly brace back to the previous line.
rejectUnauthorized: false | ||
}, function() { | ||
}, | ||
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.
Please move this back to the previous line too.
}).on('error', function(err) { | ||
throw err; | ||
}).on('close', function() { | ||
})).on('error', common.fail).on('close', 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.
one .on(
per line, please.
@cjihrig , @sam-github, did both changes please check |
crypto.createVerify('RSA-SHA1') | ||
.update('Test') | ||
.verify(certPem, 'asdfasdfas', 'base64'); | ||
} | ||
|
||
server.listen(0, function() { | ||
server.listen(0, () => { |
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 guess technically, this should be wrapped in a common.mustCall()
to make sure the inner common.mustCall()
s are executed.
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 one comment.
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions
@cjihrig did the last Nit too |
Landed in 8ab561b |
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: #10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: #10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: nodejs#10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: nodejs#10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: #10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: #10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: #10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* use common.mustCall to validate functions executions * use common.fail to check test fail * remove console.log * use arrow functions PR-URL: #10845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test