Skip to content

Commit

Permalink
test: update test-tls-check-server-identity.js
Browse files Browse the repository at this point in the history
Changed var to const, assert.equal to assert.strictEqual, and
used a template string for error output.

PR-URL: #9986
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
koxauvin authored and MylesBorins committed Jan 24, 2017
1 parent 32a69ea commit 792840a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/parallel/test-tls-check-server-identity.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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)}`);
});

0 comments on commit 792840a

Please sign in to comment.