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 targos committed Dec 26, 2016
1 parent bdf633a commit e53506a
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 e53506a

Please sign in to comment.