From 4b083b77d098e5e7738abf74814df907957e6468 Mon Sep 17 00:00:00 2001 From: Aaron Williams Date: Thu, 1 Dec 2016 10:38:22 -0600 Subject: [PATCH 1/2] test: change indexOf to includes in ecdh-disable Updates test/parallel/test-tls-ecdh-disable.js on line 34 so that assert.notEqual is changed to just assert. Then in place of indexOf, includes() is used. The callback on line 31 has been wrapped in common.mustCall() in order to ensure that this callback is only made one time. --- test/parallel/test-tls-ecdh-disable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-tls-ecdh-disable.js b/test/parallel/test-tls-ecdh-disable.js index a6ddb15cc1478e..930b0e4f08d006 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -28,10 +28,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(); - }); + })); }); From c6d99b0d417ccbb8cf787a96733c8ce56b1cf4c3 Mon Sep 17 00:00:00 2001 From: Aaron Williams Date: Mon, 5 Dec 2016 11:06:59 -0600 Subject: [PATCH 2/2] test: common.mustCall on server.listen Wraps the callback on the server.listen function in common.mustCall. --- test/parallel/test-tls-ecdh-disable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-tls-ecdh-disable.js b/test/parallel/test-tls-ecdh-disable.js index 930b0e4f08d006..c2a7440a686a10 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -20,7 +20,7 @@ var options = { var server = tls.createServer(options, common.fail); -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}`; @@ -34,4 +34,4 @@ server.listen(0, '127.0.0.1', function() { assert(stderr.includes('handshake failure')); server.close(); })); -}); +}));