Skip to content

Commit 19070e4

Browse files
lpincatargos
authored andcommitted
test: fix nits in test/fixtures/tls-connect.js
PR-URL: #28880 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 31aa33b commit 19070e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/fixtures/tls-connect.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports.debug = util.debuglog('test');
1818
exports.tls = tls;
1919

2020
// Pre-load keys from common fixtures for ease of use by tests.
21-
const keys = exports.keys = {
21+
exports.keys = {
2222
agent1: load('agent1', 'ca1'),
2323
agent2: load('agent2', 'agent2'),
2424
agent3: load('agent3', 'ca2'),
@@ -31,9 +31,9 @@ const keys = exports.keys = {
3131
ec: load('ec', 'ec'),
3232
};
3333

34-
// root is the self-signed root of the trust chain, not an intermediate ca.
34+
// `root` is the self-signed root of the trust chain, not an intermediate ca.
3535
function load(cert, root) {
36-
root = root || cert; // Assume self-signed if no issuer
36+
root = root || cert; // Assume self-signed if no issuer.
3737
const id = {
3838
key: fixtures.readKey(cert + '-key.pem', 'binary'),
3939
cert: fixtures.readKey(cert + '-cert.pem', 'binary'),
@@ -53,7 +53,7 @@ exports.connect = function connect(options, callback) {
5353
tls.createServer(options.server, function(conn) {
5454
server.conn = conn;
5555
conn.pipe(conn);
56-
maybeCallback()
56+
maybeCallback();
5757
}).listen(0, function() {
5858
server.server = this;
5959

@@ -92,7 +92,7 @@ exports.connect = function connect(options, callback) {
9292
function maybeCallback() {
9393
if (!callback)
9494
return;
95-
if (server.conn && (client.conn || client.err)) {
95+
if (server.conn && client.conn) {
9696
const err = pair.client.err || pair.server.err;
9797
callback(err, pair, cleanup);
9898
callback = null;
@@ -105,4 +105,4 @@ exports.connect = function connect(options, callback) {
105105
if (client.conn)
106106
client.conn.end();
107107
}
108-
}
108+
};

0 commit comments

Comments
 (0)