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>
This commit is contained in:
garygsc 2019-10-26 13:17:23 -06:00 committed by Gireesh Punathil
parent cf3a05ae5f
commit b27e2408af
6 changed files with 13 additions and 13 deletions

View file

@ -11,11 +11,11 @@ hooks.enable();
const rootAsyncId = async_hooks.executionAsyncId();
queueMicrotask(common.mustCall(function() {
queueMicrotask(common.mustCall(() => {
assert.strictEqual(async_hooks.triggerAsyncId(), rootAsyncId);
}));
process.on('exit', function() {
process.on('exit', () => {
hooks.sanityCheck();
const as = hooks.activitiesOfTypes('Microtask');