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:
parent
0fad875b37
commit
282e533636
@ -38,7 +38,7 @@ const options = {
|
||||
};
|
||||
|
||||
// create server
|
||||
const server = tls.Server(options, common.mustCall(function(socket) {
|
||||
const server = tls.Server(options, common.mustCall((socket) => {
|
||||
socket.end('Goodbye');
|
||||
}, 2));
|
||||
|
||||
@ -49,13 +49,13 @@ server.listen(0, function() {
|
||||
const client1 = tls.connect({
|
||||
port: this.address().port,
|
||||
rejectUnauthorized: false
|
||||
}, function() {
|
||||
}, () => {
|
||||
console.log('connect1');
|
||||
assert.ok(!client1.isSessionReused(), 'Session *should not* be reused.');
|
||||
session1 = client1.getSession();
|
||||
});
|
||||
|
||||
client1.on('close', function() {
|
||||
client1.on('close', () => {
|
||||
console.log('close1');
|
||||
|
||||
const opts = {
|
||||
@ -64,12 +64,12 @@ server.listen(0, function() {
|
||||
session: session1
|
||||
};
|
||||
|
||||
const client2 = tls.connect(opts, function() {
|
||||
const client2 = tls.connect(opts, () => {
|
||||
console.log('connect2');
|
||||
assert.ok(client2.isSessionReused(), 'Session *should* be reused.');
|
||||
});
|
||||
|
||||
client2.on('close', function() {
|
||||
client2.on('close', () => {
|
||||
console.log('close2');
|
||||
server.close();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user