summaryrefslogtreecommitdiff
path: root/test/async-hooks/test-graph.http.js
diff options
context:
space:
mode:
authorgarygsc <garygsc@gmail.com>2019-10-26 13:17:23 -0600
committerGireesh Punathil <gpunathi@in.ibm.com>2019-12-02 20:03:17 +0530
commitb27e2408af6683d34852221ae70b937b0f95943f (patch)
treeadc4c7a9f20aa89877b350b59bbd4e04f0674985 /test/async-hooks/test-graph.http.js
parentcf3a05ae5f8c78dd837b0135f467683477ccc5bc (diff)
downloadandroid-node-v8-b27e2408af6683d34852221ae70b937b0f95943f.tar.gz
android-node-v8-b27e2408af6683d34852221ae70b937b0f95943f.tar.bz2
android-node-v8-b27e2408af6683d34852221ae70b937b0f95943f.zip
test: use arrow functions in async-hooks tests
Convert all anonymous callback functions in `test/async-hooks/*.js` to use arrow functions. `writing-tests.md` states to use arrow functions when appropriate. PR-URL: https://github.com/nodejs/node/pull/30137 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test/async-hooks/test-graph.http.js')
-rw-r--r--test/async-hooks/test-graph.http.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/async-hooks/test-graph.http.js b/test/async-hooks/test-graph.http.js
index 12862467a6..db0c126567 100644
--- a/test/async-hooks/test-graph.http.js
+++ b/test/async-hooks/test-graph.http.js
@@ -11,11 +11,11 @@ const http = require('http');
const hooks = initHooks();
hooks.enable();
-const server = http.createServer(common.mustCall(function(req, res) {
+const server = http.createServer(common.mustCall((req, res) => {
res.end();
- this.close(common.mustCall());
+ server.close(common.mustCall());
}));
-server.listen(0, common.mustCall(function() {
+server.listen(0, common.mustCall(() => {
http.get({
host: '::1',
family: 6,
@@ -23,7 +23,7 @@ server.listen(0, common.mustCall(function() {
}, common.mustCall());
}));
-process.on('exit', function() {
+process.on('exit', () => {
hooks.disable();
verifyGraph(