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:
parent
12b69f9765
commit
80671dc1f9
@ -38,7 +38,7 @@ const options = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// create server
|
// create server
|
||||||
const server = https.createServer(options, common.mustCall(function(req, res) {
|
const server = https.createServer(options, common.mustCall((req, res) => {
|
||||||
res.end('Goodbye');
|
res.end('Goodbye');
|
||||||
}, 2));
|
}, 2));
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ 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();
|
||||||
@ -58,7 +58,7 @@ server.listen(0, function() {
|
|||||||
'\r\n');
|
'\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
client1.on('close', function() {
|
client1.on('close', () => {
|
||||||
console.log('close1');
|
console.log('close1');
|
||||||
|
|
||||||
const opts = {
|
const opts = {
|
||||||
@ -67,7 +67,7 @@ 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.write('GET / HTTP/1.0\r\n' +
|
client2.write('GET / HTTP/1.0\r\n' +
|
||||||
@ -75,7 +75,7 @@ server.listen(0, function() {
|
|||||||
'\r\n');
|
'\r\n');
|
||||||
});
|
});
|
||||||
|
|
||||||
client2.on('close', function() {
|
client2.on('close', () => {
|
||||||
console.log('close2');
|
console.log('close2');
|
||||||
server.close();
|
server.close();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user