Skip to content

Commit c341c18

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 3159836 commit c341c18

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
@@ -29,18 +29,18 @@ var server = tls.createServer(options, function(conn) {
2929
nconns++;
3030
});
3131

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

3636
// for the performance and stability issue in s_client on Windows
3737
if (common.isWindows)
3838
cmd += ' -no_rand_screen';
3939

40-
exec(cmd, function(err, stdout, stderr) {
40+
exec(cmd, common.mustCall(function(err, stdout, stderr) {
4141
// Old versions of openssl will still exit with 0 so we
4242
// can't just check if err is not null.
43-
assert.notEqual(stderr.indexOf('handshake failure'), -1);
43+
assert(stderr.includes('handshake failure'));
4444
server.close();
45-
});
46-
});
45+
}));
46+
}));

0 commit comments

Comments
 (0)