From 295eb5a3b69cc2cc61a537d668fde469eb08a9d8 Mon Sep 17 00:00:00 2001 From: Peter Masucci Date: Thu, 1 Dec 2016 11:01:54 -0500 Subject: [PATCH] test: swap var->const/let and equal->strictEqual Change instances of var with const/let. Change assert.equal to assert.strictEqual. PR-URL: https://github.com/nodejs/node/pull/9888 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-tls-no-sslv3.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/parallel/test-tls-no-sslv3.js b/test/parallel/test-tls-no-sslv3.js index c284356ce37bb6..16a722ef85b9da 100644 --- a/test/parallel/test-tls-no-sslv3.js +++ b/test/parallel/test-tls-no-sslv3.js @@ -1,30 +1,30 @@ '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'); return; } -var tls = require('tls'); +const tls = require('tls'); -var fs = require('fs'); -var spawn = require('child_process').spawn; +const fs = require('fs'); +const spawn = require('child_process').spawn; if (common.opensslCli === false) { common.skip('node compiled without OpenSSL CLI.'); return; } -var cert = fs.readFileSync(common.fixturesDir + '/test_cert.pem'); -var key = fs.readFileSync(common.fixturesDir + '/test_key.pem'); -var server = tls.createServer({ cert: cert, key: key }, common.fail); -var errors = []; -var stderr = ''; +const cert = fs.readFileSync(common.fixturesDir + '/test_cert.pem'); +const key = fs.readFileSync(common.fixturesDir + '/test_key.pem'); +const server = tls.createServer({ cert: cert, key: key }, common.fail); +const errors = []; +let stderr = ''; server.listen(0, '127.0.0.1', function() { - var address = this.address().address + ':' + this.address().port; - var args = ['s_client', + const address = this.address().address + ':' + this.address().port; + const args = ['s_client', '-ssl3', '-connect', address]; @@ -32,14 +32,14 @@ server.listen(0, '127.0.0.1', function() { if (common.isWindows) args.push('-no_rand_screen'); - var client = spawn(common.opensslCli, args, { stdio: 'pipe' }); + const client = spawn(common.opensslCli, args, { stdio: 'pipe' }); client.stdout.pipe(process.stdout); client.stderr.pipe(process.stderr); client.stderr.setEncoding('utf8'); client.stderr.on('data', (data) => stderr += data); client.once('exit', common.mustCall(function(exitCode) { - assert.equal(exitCode, 1); + assert.strictEqual(exitCode, 1); server.close(); })); }); @@ -50,7 +50,7 @@ process.on('exit', function() { if (/unknown option -ssl3/.test(stderr)) { common.skip('`openssl s_client -ssl3` not supported.'); } else { - assert.equal(errors.length, 1); + assert.strictEqual(errors.length, 1); assert(/:wrong version number/.test(errors[0].message)); } });