From 6f8c90174eff5291011e89fcdcd7ace4a1162123 Mon Sep 17 00:00:00 2001 From: Aaron Williams Date: Thu, 1 Dec 2016 10:38:22 -0600 Subject: [PATCH] test: refactor test-tls-ecdh-disable * use common.mustCall() * use String.prototype.includes() instead of String.prototype.indexOf() PR-URL: https://github.com/nodejs/node/pull/9989 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/parallel/test-tls-ecdh-disable.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-tls-ecdh-disable.js b/test/parallel/test-tls-ecdh-disable.js index b6e060f35aed23..2e8ef38400caa1 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -29,7 +29,7 @@ var server = tls.createServer(options, function(conn) { nconns++; }); -server.listen(0, '127.0.0.1', function() { +server.listen(0, '127.0.0.1', common.mustCall(function() { var cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers + ` -connect 127.0.0.1:${this.address().port}`; @@ -37,10 +37,10 @@ server.listen(0, '127.0.0.1', function() { if (common.isWindows) cmd += ' -no_rand_screen'; - exec(cmd, function(err, stdout, stderr) { + exec(cmd, common.mustCall(function(err, stdout, stderr) { // Old versions of openssl will still exit with 0 so we // can't just check if err is not null. - assert.notEqual(stderr.indexOf('handshake failure'), -1); + assert(stderr.includes('handshake failure')); server.close(); - }); -}); + })); +}));