From 3c3d2d6776cb80514a8bf22aebfdfd67bdbd8250 Mon Sep 17 00:00:00 2001 From: Harish Tejwani Date: Thu, 1 Dec 2016 10:52:33 -0600 Subject: [PATCH] test: refactor test-tls-client-getephemeralkeyinfo change var to const and add mustCall PR-URL: https://github.com/nodejs/node/pull/9954 Reviewed-By: Prince John Wesley Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- .../test-tls-client-getephemeralkeyinfo.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/parallel/test-tls-client-getephemeralkeyinfo.js b/test/parallel/test-tls-client-getephemeralkeyinfo.js index 38fd602b1c2262..c1e6597245a612 100644 --- a/test/parallel/test-tls-client-getephemeralkeyinfo.js +++ b/test/parallel/test-tls-client-getephemeralkeyinfo.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); process.exit(); } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'); -var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'); +const fs = require('fs'); +const key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'); +const cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'); var ntests = 0; var nsuccess = 0; @@ -45,12 +45,12 @@ function test(size, type, name, next) { conn.end(); }); - server.on('close', function(err) { + server.on('close', common.mustCall(function(err) { assert(!err); if (next) next(); - }); + })); - server.listen(0, '127.0.0.1', function() { + server.listen(0, '127.0.0.1', common.mustCall(function() { var client = tls.connect({ port: this.address().port, rejectUnauthorized: false @@ -62,7 +62,7 @@ function test(size, type, name, next) { nsuccess++; server.close(); }); - }); + })); } function testNOT_PFS() {