summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbhishek Dixit <abhishek.dixit@genisys-group.com>2018-11-17 17:19:38 +0530
committerRich Trott <rtrott@gmail.com>2018-11-20 22:35:28 -0800
commit62fe4165f091375feb389e640afe112fdcea7276 (patch)
tree532d458c7d2e68decd4fba3c7dbdd060d153755d /test
parentd88e26de8e1b8d4b337290ffd712543c1ef53de9 (diff)
downloadandroid-node-v8-62fe4165f091375feb389e640afe112fdcea7276.tar.gz
android-node-v8-62fe4165f091375feb389e640afe112fdcea7276.tar.bz2
android-node-v8-62fe4165f091375feb389e640afe112fdcea7276.zip
test: replace anonymous closure functions with arrow function
PR-URL: https://github.com/nodejs/node/pull/24420 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-tls-ticket-cluster.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/parallel/test-tls-ticket-cluster.js b/test/parallel/test-tls-ticket-cluster.js
index a139cccad3..32a5c671d8 100644
--- a/test/parallel/test-tls-ticket-cluster.js
+++ b/test/parallel/test-tls-ticket-cluster.js
@@ -44,7 +44,7 @@ if (cluster.isMaster) {
const c = tls.connect(workerPort, {
session: lastSession,
rejectUnauthorized: false
- }, function() {
+ }, () => {
lastSession = c.getSession();
c.end();
@@ -60,7 +60,7 @@ if (cluster.isMaster) {
function fork() {
const worker = cluster.fork();
- worker.on('message', function({ msg, port }) {
+ worker.on('message', ({ msg, port }) => {
console.error('[master] got %j', msg);
if (msg === 'reused') {
++reusedCount;
@@ -71,7 +71,7 @@ if (cluster.isMaster) {
}
});
- worker.on('exit', function() {
+ worker.on('exit', () => {
console.error('[master] worker died');
});
}
@@ -79,7 +79,7 @@ if (cluster.isMaster) {
fork();
}
- process.on('exit', function() {
+ process.on('exit', () => {
assert.strictEqual(reqCount, expectedReqCount);
assert.strictEqual(reusedCount + 1, reqCount);
});
@@ -91,7 +91,7 @@ const cert = fixtures.readSync('agent.crt');
const options = { key, cert };
-const server = tls.createServer(options, function(c) {
+const server = tls.createServer(options, (c) => {
if (c.isSessionReused()) {
process.send({ msg: 'reused' });
} else {
@@ -100,7 +100,7 @@ const server = tls.createServer(options, function(c) {
c.end();
});
-server.listen(0, function() {
+server.listen(0, () => {
const { port } = server.address();
process.send({
msg: 'listening',
@@ -111,7 +111,7 @@ server.listen(0, function() {
process.on('message', function listener(msg) {
console.error('[worker] got %j', msg);
if (msg === 'die') {
- server.close(function() {
+ server.close(() => {
console.error('[worker] server close');
process.exit();
@@ -119,6 +119,6 @@ process.on('message', function listener(msg) {
}
});
-process.on('exit', function() {
+process.on('exit', () => {
console.error('[worker] exit');
});