From b00f8ad13a7263c7438a5eec76b6aa93e0dbec28 Mon Sep 17 00:00:00 2001 From: Kevin Cox Date: Thu, 1 Dec 2016 11:01:49 -0600 Subject: [PATCH] test: update test-tls-check-server-identity.js Changed var to const, assert.equal to assert.strictEqual, and used a template string for error output. PR-URL: https://github.com/nodejs/node/pull/9986 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- .../test-tls-check-server-identity.js | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/parallel/test-tls-check-server-identity.js b/test/parallel/test-tls-check-server-identity.js index 0732ab3c0fcd67..5c89ef8bf4d425 100644 --- a/test/parallel/test-tls-check-server-identity.js +++ b/test/parallel/test-tls-check-server-identity.js @@ -1,16 +1,17 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var util = require('util'); +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var tls = require('tls'); +const assert = require('assert'); +const util = require('util'); -var tests = [ +const tls = require('tls'); + +const tests = [ // False-y values. { host: false, @@ -253,9 +254,9 @@ var tests = [ ]; tests.forEach(function(test, i) { - var err = tls.checkServerIdentity(test.host, test.cert); - assert.equal(err && err.reason, - test.error, - 'Test#' + i + ' failed: ' + util.inspect(test) + '\n' + - test.error + ' != ' + (err && err.reason)); + const err = tls.checkServerIdentity(test.host, test.cert); + assert.strictEqual(err && err.reason, + test.error, + `Test# ${i} failed: ${util.inspect(test)} \n` + + `${test.error} != ${(err && err.reason)}`); });