diff --git a/test/async-hooks/test-late-hook-enable.js b/test/async-hooks/test-late-hook-enable.js index 82a80b24bb777c..7ee1323adbdbcc 100644 --- a/test/async-hooks/test-late-hook-enable.js +++ b/test/async-hooks/test-late-hook-enable.js @@ -33,7 +33,7 @@ const fnsToTest = [setTimeout, (cb) => { const hook = async_hooks.createHook({ before: common.mustNotCall(), - after: common.mustCall(() => {}, 3), + after: common.mustCall(3), destroy: common.mustCall(() => { hook.disable(); nextTest(); diff --git a/test/parallel/test-async-hooks-enable-before-promise-resolve.js b/test/parallel/test-async-hooks-enable-before-promise-resolve.js index c96c9e5dd96655..4f6e65df9d29e3 100644 --- a/test/parallel/test-async-hooks-enable-before-promise-resolve.js +++ b/test/parallel/test-async-hooks-enable-before-promise-resolve.js @@ -12,7 +12,7 @@ const promise = new Promise((resolve) => { setTimeout(() => { initialAsyncId = async_hooks.executionAsyncId(); async_hooks.createHook({ - after: common.mustCall(() => {}, 2) + after: common.mustCall(2) }).enable(); resolve(); }, 0); diff --git a/test/parallel/test-async-hooks-enable-disable.js b/test/parallel/test-async-hooks-enable-disable.js index b685c7123454dd..71d35c91371f60 100644 --- a/test/parallel/test-async-hooks-enable-disable.js +++ b/test/parallel/test-async-hooks-enable-disable.js @@ -4,7 +4,7 @@ const assert = require('assert'); const async_hooks = require('async_hooks'); const hook = async_hooks.createHook({ - init: common.mustCall(() => {}, 1), + init: common.mustCall(1), before: common.mustNotCall(), after: common.mustNotCall(), destroy: common.mustNotCall() diff --git a/test/parallel/test-cluster-worker-kill-signal.js b/test/parallel/test-cluster-worker-kill-signal.js index 2f1a8ae991dde4..b0bf8995cb33a6 100644 --- a/test/parallel/test-cluster-worker-kill-signal.js +++ b/test/parallel/test-cluster-worker-kill-signal.js @@ -45,5 +45,5 @@ if (cluster.isWorker) { }, 1)); // Check if the cluster was killed as well - cluster.on('exit', common.mustCall(() => {}, 1)); + cluster.on('exit', common.mustCall(1)); } diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index 1f374efbb66610..3e98e76d0e6f2b 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -70,20 +70,20 @@ assert.throws( message: /^fhqwhgads$/ }); -const fnOnce = common.mustCall(() => {}); +const fnOnce = common.mustCall(); fnOnce(); -const fnTwice = common.mustCall(() => {}, 2); +const fnTwice = common.mustCall(2); fnTwice(); fnTwice(); -const fnAtLeast1Called1 = common.mustCallAtLeast(() => {}, 1); +const fnAtLeast1Called1 = common.mustCallAtLeast(1); fnAtLeast1Called1(); -const fnAtLeast1Called2 = common.mustCallAtLeast(() => {}, 1); +const fnAtLeast1Called2 = common.mustCallAtLeast(1); fnAtLeast1Called2(); fnAtLeast1Called2(); -const fnAtLeast2Called2 = common.mustCallAtLeast(() => {}, 2); +const fnAtLeast2Called2 = common.mustCallAtLeast(2); fnAtLeast2Called2(); fnAtLeast2Called2(); -const fnAtLeast2Called3 = common.mustCallAtLeast(() => {}, 2); +const fnAtLeast2Called3 = common.mustCallAtLeast(2); fnAtLeast2Called3(); fnAtLeast2Called3(); fnAtLeast2Called3(); diff --git a/test/parallel/test-dgram-bind-fd.js b/test/parallel/test-dgram-bind-fd.js index a1382d93ff3889..daf7f8064bda45 100644 --- a/test/parallel/test-dgram-bind-fd.js +++ b/test/parallel/test-dgram-bind-fd.js @@ -95,7 +95,7 @@ const BUFFER_SIZE = 4096; assert.fail(err.message); }); - socket.on('close', common.mustCall(() => {})); + socket.on('close', common.mustCall()); })); receiver.on('message', common.mustCall((data, { address, port }) => { @@ -109,7 +109,7 @@ const BUFFER_SIZE = 4096; assert.fail(err.message); }); - receiver.on('close', common.mustCall(() => {})); + receiver.on('close', common.mustCall()); } testWithOptions(true, true); diff --git a/test/parallel/test-dns-get-server.js b/test/parallel/test-dns-get-server.js index 24c01218fad519..4fa983c243f246 100644 --- a/test/parallel/test-dns-get-server.js +++ b/test/parallel/test-dns-get-server.js @@ -7,5 +7,5 @@ const { Resolver } = require('dns'); const resolver = new Resolver(); assert(resolver.getServers().length > 0); // return undefined -resolver._handle.getServers = common.mustCall(() => {}); +resolver._handle.getServers = common.mustCall(); assert.strictEqual(resolver.getServers().length, 0); diff --git a/test/parallel/test-fs-stat.js b/test/parallel/test-fs-stat.js index dc4fc6df8c8067..8eca34c684035f 100644 --- a/test/parallel/test-fs-stat.js +++ b/test/parallel/test-fs-stat.js @@ -151,12 +151,12 @@ fs.stat(__filename, common.mustSucceed((s) => { }); // Should not throw an error -fs.stat(__filename, undefined, common.mustCall(() => {})); +fs.stat(__filename, undefined, common.mustCall()); fs.open(__filename, 'r', undefined, common.mustCall((err, fd) => { // Should not throw an error - fs.fstat(fd, undefined, common.mustCall(() => {})); + fs.fstat(fd, undefined, common.mustCall()); })); // Should not throw an error -fs.lstat(__filename, undefined, common.mustCall(() => {})); +fs.lstat(__filename, undefined, common.mustCall()); diff --git a/test/parallel/test-fs-watch-close-when-destroyed.js b/test/parallel/test-fs-watch-close-when-destroyed.js index aee4d0e61f04da..2dfff953aa9214 100644 --- a/test/parallel/test-fs-watch-close-when-destroyed.js +++ b/test/parallel/test-fs-watch-close-when-destroyed.js @@ -37,6 +37,6 @@ watcher.addListener('change', () => { fs.rmdirSync(root); // Wait for the listener to hit setTimeout( - common.mustCall(() => {}), + common.mustCall(), common.platformTimeout(100) ); diff --git a/test/parallel/test-http2-respond-with-file-connection-abort.js b/test/parallel/test-http2-respond-with-file-connection-abort.js index ed200e5b391fe8..d5ed3645708d95 100644 --- a/test/parallel/test-http2-respond-with-file-connection-abort.js +++ b/test/parallel/test-http2-respond-with-file-connection-abort.js @@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => { const client = http2.connect(`http://localhost:${server.address().port}`); const req = client.request(); - req.on('response', common.mustCall(() => {})); + req.on('response', common.mustCall()); req.once('data', common.mustCall(() => { net.Socket.prototype.destroy.call(client.socket); server.close(); diff --git a/test/parallel/test-http2-window-size.js b/test/parallel/test-http2-window-size.js index b5940f29583a77..d0ae48361ef42b 100644 --- a/test/parallel/test-http2-window-size.js +++ b/test/parallel/test-http2-window-size.js @@ -100,4 +100,4 @@ for (const buffers of buffersList) { p = p.then(() => run(buffers, initialWindowSize)); } } -p.then(common.mustCall(() => {})); +p.then(common.mustCall()); diff --git a/test/parallel/test-net-socket-end-callback.js b/test/parallel/test-net-socket-end-callback.js index 6aa53251f502a6..a52cee6794f8e4 100644 --- a/test/parallel/test-net-socket-end-callback.js +++ b/test/parallel/test-net-socket-end-callback.js @@ -14,7 +14,7 @@ server.listen(common.mustCall(() => { }); }; - const cb = common.mustCall(() => {}, 3); + const cb = common.mustCall(3); connect(cb); connect('foo', cb); diff --git a/test/parallel/test-net-socket-setnodelay.js b/test/parallel/test-net-socket-setnodelay.js index da1d9a4a314882..0be94a7ba461ee 100644 --- a/test/parallel/test-net-socket-setnodelay.js +++ b/test/parallel/test-net-socket-setnodelay.js @@ -37,7 +37,7 @@ falseyValues.forEach((testVal) => socket.setNoDelay(testVal)); socket = new net.Socket({ handle: { - setNoDelay: common.mustCall(() => {}, 3), + setNoDelay: common.mustCall(3), readStart() {} } }); diff --git a/test/parallel/test-promise-hook-exceptions.js b/test/parallel/test-promise-hook-exceptions.js index d1251502d840b9..199ad2c52d2f35 100644 --- a/test/parallel/test-promise-hook-exceptions.js +++ b/test/parallel/test-promise-hook-exceptions.js @@ -26,6 +26,6 @@ testHook('onSettled'); testHook('onBefore'); testHook('onAfter'); -const stop = promiseHooks.onInit(common.mustCall(() => {}, 2)); +const stop = promiseHooks.onInit(common.mustCall(2)); Promise.resolve().then(stop); diff --git a/test/parallel/test-stream-duplex-from.js b/test/parallel/test-stream-duplex-from.js index afe4626ebbb9ae..ba445f892e4bb6 100644 --- a/test/parallel/test-stream-duplex-from.js +++ b/test/parallel/test-stream-duplex-from.js @@ -142,7 +142,7 @@ const { Blob } = require('buffer'); } assert.strictEqual(ret, 'abcdefghi'); }, - common.mustCall(() => {}), + common.mustCall(), ); } diff --git a/test/parallel/test-stream-pipeline-queued-end-in-destroy.js b/test/parallel/test-stream-pipeline-queued-end-in-destroy.js index d5e399ddda531b..480e5b7f7258f2 100644 --- a/test/parallel/test-stream-pipeline-queued-end-in-destroy.js +++ b/test/parallel/test-stream-pipeline-queued-end-in-destroy.js @@ -9,7 +9,7 @@ const { Readable, Duplex, pipeline } = require('stream'); // Refs: https://github.com/nodejs/node/issues/24456 const readable = new Readable({ - read: common.mustCall(() => {}) + read: common.mustCall() }); const duplex = new Duplex({ diff --git a/test/parallel/test-stream-pipeline-with-empty-string.js b/test/parallel/test-stream-pipeline-with-empty-string.js index 8818f38e8596f2..3f5ee799c53386 100644 --- a/test/parallel/test-stream-pipeline-with-empty-string.js +++ b/test/parallel/test-stream-pipeline-with-empty-string.js @@ -15,4 +15,4 @@ async function runTest() { ); } -runTest().then(common.mustCall(() => {})); +runTest().then(common.mustCall()); diff --git a/test/parallel/test-stream-readable-unshift.js b/test/parallel/test-stream-readable-unshift.js index 6eefb55d73bc88..cccc834fc1947b 100644 --- a/test/parallel/test-stream-readable-unshift.js +++ b/test/parallel/test-stream-readable-unshift.js @@ -165,6 +165,6 @@ const { Readable } = require('stream'); const stream = new ArrayReader(); stream.once('readable', common.mustCall(onRead)); - stream.on('end', common.mustCall(() => {})); + stream.on('end', common.mustCall()); } diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index d7153b87ba7f19..6411e68bd2d1a8 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -45,7 +45,7 @@ const server = tls.createServer({ }, common.mustCall(function() { // Send close-notify without shutting down TCP socket. const req = new ShutdownWrap(); - req.oncomplete = common.mustCall(() => {}); + req.oncomplete = common.mustCall(); req.handle = c._handle; c._handle.shutdown(req); })); diff --git a/test/parallel/test-ttywrap-stack.js b/test/parallel/test-ttywrap-stack.js index b2ad69b1b2ecdc..6fa85a338f1129 100644 --- a/test/parallel/test-ttywrap-stack.js +++ b/test/parallel/test-ttywrap-stack.js @@ -5,7 +5,7 @@ const common = require('../common'); // will not crash the process if there // is not enough space on the V8 stack -const done = common.mustCall(() => {}); +const done = common.mustCall(); async function test() { await test(); diff --git a/test/parallel/test-worker-data-url.js b/test/parallel/test-worker-data-url.js index fe73ba8824ba07..f224ebcf447c7b 100644 --- a/test/parallel/test-worker-data-url.js +++ b/test/parallel/test-worker-data-url.js @@ -10,14 +10,14 @@ new Worker(new URL('data:text/javascript,export{}')) .on('error', common.mustNotCall(() => {})); new Worker(new URL('data:text/plain,')) - .on('error', common.mustCall(() => {})); + .on('error', common.mustCall()); new Worker(new URL('data:text/javascript,module.exports={}')) - .on('error', common.mustCall(() => {})); + .on('error', common.mustCall()); new Worker(new URL('data:text/javascript,await Promise.resolve()')) .on('error', common.mustNotCall(() => {})); new Worker(new URL('data:text/javascript,await Promise.reject()')) - .on('error', common.mustCall(() => {})); + .on('error', common.mustCall()); new Worker(new URL('data:text/javascript,await new Promise(()=>{})')) .on( 'exit', diff --git a/test/sequential/test-tls-lookup.js b/test/sequential/test-tls-lookup.js index dcdd9724e3c070..dba39c17ab7b31 100644 --- a/test/sequential/test-tls-lookup.js +++ b/test/sequential/test-tls-lookup.js @@ -21,7 +21,7 @@ const tls = require('tls'); }); }); -connectDoesNotThrow(common.mustCall(() => {})); +connectDoesNotThrow(common.mustCall()); function connectDoesNotThrow(input) { const opts = {