test: replace anonymous function with arrow func

PR-URL: https://github.com/nodejs/node/pull/24525
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
Gagandeep Singh 2018-11-20 23:53:56 +05:30 committed by Daniel Bevenius
parent 12b69f9765
commit 80671dc1f9

View File

@ -38,7 +38,7 @@ const options = {
};
// create server
const server = https.createServer(options, common.mustCall(function(req, res) {
const server = https.createServer(options, common.mustCall((req, res) => {
res.end('Goodbye');
}, 2));
@ -49,7 +49,7 @@ 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();
@ -58,7 +58,7 @@ server.listen(0, function() {
'\r\n');
});
client1.on('close', function() {
client1.on('close', () => {
console.log('close1');
const opts = {
@ -67,7 +67,7 @@ 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.write('GET / HTTP/1.0\r\n' +
@ -75,7 +75,7 @@ server.listen(0, function() {
'\r\n');
});
client2.on('close', function() {
client2.on('close', () => {
console.log('close2');
server.close();
});