From 0d2c792842cf9a0614ef82e2dc3ddcd4daec7b1a Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Tue, 12 Jul 2022 11:45:27 +0200 Subject: [PATCH] Review suggestions --- test/parallel/test-process-beforeexit.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-process-beforeexit.js b/test/parallel/test-process-beforeexit.js index 5386318e63891a..5c55fcd3e0e178 100644 --- a/test/parallel/test-process-beforeexit.js +++ b/test/parallel/test-process-beforeexit.js @@ -40,7 +40,7 @@ function tryTimer() { function tryListen() { net.createServer() .listen(0) - .on('listening', common.mustCall(function() { + .on('listening', common.mustCall(function () { this.close(); process.once('beforeExit', common.mustCall(tryRepeatedTimer)); })); @@ -55,27 +55,27 @@ function tryListen() { function tryRepeatedTimer() { const N = 5; let n = 0; - const repeatedTimer = common.mustCall(function() { + const repeatedTimer = common.mustCall(function () { if (++n < N) setTimeout(repeatedTimer, 1); else // n == N - process.once('beforeExit', common.mustCall(tryNextTick1)); + process.once('beforeExit', common.mustCall(tryNextTickSetImmediate)); }, N); setTimeout(repeatedTimer, 1); } // Test if the callback of `process.nextTick` can be invoked. -function tryNextTick1() { - process.nextTick(common.mustCall(function() { +function tryNextTickSetImmediate() { + process.nextTick(common.mustCall(function () { setImmediate(common.mustCall(() => { - process.once('beforeExit', common.mustCall(tryNextTick2)); + process.once('beforeExit', common.mustCall(tryNextTick)); })); })); } // Test that `process.nextTick` won't keep the event loop running by itself. -function tryNextTick2() { - process.nextTick(common.mustCall(function() { +function tryNextTick() { + process.nextTick(common.mustCall(function () { process.once('beforeExit', common.mustNotCall()); })); }