summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGagandeep Singh <codegagan@gmail.com>2018-11-21 00:41:14 +0530
committerGireesh Punathil <gpunathi@in.ibm.com>2018-11-25 18:12:47 +0530
commitdb84fd24ca38839cad347b49fb075d200f00007f (patch)
treea77ab6e855b938f642b0de01dc333edc52699e75 /test
parente20be47c17e7117091528953d74eb63671c655d6 (diff)
downloadandroid-node-v8-db84fd24ca38839cad347b49fb075d200f00007f.tar.gz
android-node-v8-db84fd24ca38839cad347b49fb075d200f00007f.tar.bz2
android-node-v8-db84fd24ca38839cad347b49fb075d200f00007f.zip
test: change anonymous function to arrow function
PR-URL: https://github.com/nodejs/node/pull/24528 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http-client-timeout-agent.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-http-client-timeout-agent.js b/test/parallel/test-http-client-timeout-agent.js
index 8ce14f865c..2f4aeed975 100644
--- a/test/parallel/test-http-client-timeout-agent.js
+++ b/test/parallel/test-http-client-timeout-agent.js
@@ -32,7 +32,7 @@ const options = {
host: '127.0.0.1',
};
-const server = http.createServer(function(req, res) {
+const server = http.createServer((req, res) => {
const m = /\/(.*)/.exec(req.url);
const reqid = parseInt(m[1], 10);
if (reqid % 2) {
@@ -51,7 +51,7 @@ server.listen(0, options.host, function() {
options.path = `/${requests_sent}`;
const req = http.request(options);
req.id = requests_sent;
- req.on('response', function(res) {
+ req.on('response', (res) => {
res.on('data', function(data) {
console.log(`res#${this.req.id} data:${data}`);
});
@@ -78,7 +78,7 @@ server.listen(0, options.host, function() {
setTimeout(function maybeDone() {
if (requests_done >= requests_sent) {
- setTimeout(function() {
+ setTimeout(() => {
server.close();
}, 100);
} else {
@@ -87,7 +87,7 @@ server.listen(0, options.host, function() {
}, 100);
});
-process.on('exit', function() {
+process.on('exit', () => {
console.error(`done=${requests_done} sent=${requests_sent}`);
// check that timeout on http request was not called too much
assert.strictEqual(requests_done, requests_sent);