test: using arrow functions

- Using arrow functions in test-tls-client-resume.js
    - Fixed error, Expected parentheses around arrow function
      argument arrow-parens

PR-URL: https://github.com/nodejs/node/pull/24436
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
NoSkillGirl 2018-11-21 05:14:49 +05:30 committed by Daniel Bevenius
parent 0fad875b37
commit 282e533636

View File

@ -38,7 +38,7 @@ const options = {
}; };
// create server // create server
const server = tls.Server(options, common.mustCall(function(socket) { const server = tls.Server(options, common.mustCall((socket) => {
socket.end('Goodbye'); socket.end('Goodbye');
}, 2)); }, 2));
@ -49,13 +49,13 @@ server.listen(0, function() {
const client1 = tls.connect({ const client1 = tls.connect({
port: this.address().port, port: this.address().port,
rejectUnauthorized: false rejectUnauthorized: false
}, function() { }, () => {
console.log('connect1'); console.log('connect1');
assert.ok(!client1.isSessionReused(), 'Session *should not* be reused.'); assert.ok(!client1.isSessionReused(), 'Session *should not* be reused.');
session1 = client1.getSession(); session1 = client1.getSession();
}); });
client1.on('close', function() { client1.on('close', () => {
console.log('close1'); console.log('close1');
const opts = { const opts = {
@ -64,12 +64,12 @@ server.listen(0, function() {
session: session1 session: session1
}; };
const client2 = tls.connect(opts, function() { const client2 = tls.connect(opts, () => {
console.log('connect2'); console.log('connect2');
assert.ok(client2.isSessionReused(), 'Session *should* be reused.'); assert.ok(client2.isSessionReused(), 'Session *should* be reused.');
}); });
client2.on('close', function() { client2.on('close', () => {
console.log('close2'); console.log('close2');
server.close(); server.close();
}); });