summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2019-07-28 15:25:30 +0200
committerRich Trott <rtrott@gmail.com>2019-07-30 14:02:19 -0700
commit834a413eed7c5f6a415e00b14d499c5cb0a34fca (patch)
tree3e069c7aed0235f8122447601cd491646097fe30 /test
parent985c5f5b7e079689211649f19097617075a19a42 (diff)
downloadandroid-node-v8-834a413eed7c5f6a415e00b14d499c5cb0a34fca.tar.gz
android-node-v8-834a413eed7c5f6a415e00b14d499c5cb0a34fca.tar.bz2
android-node-v8-834a413eed7c5f6a415e00b14d499c5cb0a34fca.zip
test: fix nits in test/fixtures/tls-connect.js
PR-URL: https://github.com/nodejs/node/pull/28880 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/tls-connect.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/fixtures/tls-connect.js b/test/fixtures/tls-connect.js
index 764bea7703..51c0b328e9 100644
--- a/test/fixtures/tls-connect.js
+++ b/test/fixtures/tls-connect.js
@@ -18,7 +18,7 @@ exports.debug = util.debuglog('test');
exports.tls = tls;
// Pre-load keys from common fixtures for ease of use by tests.
-const keys = exports.keys = {
+exports.keys = {
agent1: load('agent1', 'ca1'),
agent2: load('agent2', 'agent2'),
agent3: load('agent3', 'ca2'),
@@ -31,9 +31,9 @@ const keys = exports.keys = {
ec: load('ec', 'ec'),
};
-// root is the self-signed root of the trust chain, not an intermediate ca.
+// `root` is the self-signed root of the trust chain, not an intermediate ca.
function load(cert, root) {
- root = root || cert; // Assume self-signed if no issuer
+ root = root || cert; // Assume self-signed if no issuer.
const id = {
key: fixtures.readKey(cert + '-key.pem', 'binary'),
cert: fixtures.readKey(cert + '-cert.pem', 'binary'),
@@ -53,7 +53,7 @@ exports.connect = function connect(options, callback) {
tls.createServer(options.server, function(conn) {
server.conn = conn;
conn.pipe(conn);
- maybeCallback()
+ maybeCallback();
}).listen(0, function() {
server.server = this;
@@ -92,7 +92,7 @@ exports.connect = function connect(options, callback) {
function maybeCallback() {
if (!callback)
return;
- if (server.conn && (client.conn || client.err)) {
+ if (server.conn && client.conn) {
const err = pair.client.err || pair.server.err;
callback(err, pair, cleanup);
callback = null;
@@ -105,4 +105,4 @@ exports.connect = function connect(options, callback) {
if (client.conn)
client.conn.end();
}
-}
+};