Skip to content

Commit 2458501

Browse files
Aaron WilliamsMylesBorins
Aaron Williams
authored andcommitted
test: refactor test-tls-ecdh-disable
* use common.mustCall() * use String.prototype.includes() instead of String.prototype.indexOf() PR-URL: #9989 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 980b4db commit 2458501

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-tls-ecdh-disable.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ var options = {
2020

2121
var server = tls.createServer(options, common.fail);
2222

23-
server.listen(0, '127.0.0.1', function() {
23+
server.listen(0, '127.0.0.1', common.mustCall(function() {
2424
var cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers +
2525
` -connect 127.0.0.1:${this.address().port}`;
2626

2727
// for the performance and stability issue in s_client on Windows
2828
if (common.isWindows)
2929
cmd += ' -no_rand_screen';
3030

31-
exec(cmd, function(err, stdout, stderr) {
31+
exec(cmd, common.mustCall(function(err, stdout, stderr) {
3232
// Old versions of openssl will still exit with 0 so we
3333
// can't just check if err is not null.
34-
assert.notEqual(stderr.indexOf('handshake failure'), -1);
34+
assert(stderr.includes('handshake failure'));
3535
server.close();
36-
});
37-
});
36+
}));
37+
}));

0 commit comments

Comments
 (0)