Skip to content

Commit e5928ab

Browse files
Trottdanielleadams
authored andcommitted
test: remove unnecessary noop function args to mustCall()
PR-URL: #45027 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 2aac993 commit e5928ab

22 files changed

+32
-32
lines changed

test/async-hooks/test-late-hook-enable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const fnsToTest = [setTimeout, (cb) => {
3333

3434
const hook = async_hooks.createHook({
3535
before: common.mustNotCall(),
36-
after: common.mustCall(() => {}, 3),
36+
after: common.mustCall(3),
3737
destroy: common.mustCall(() => {
3838
hook.disable();
3939
nextTest();

test/parallel/test-async-hooks-enable-before-promise-resolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const promise = new Promise((resolve) => {
1212
setTimeout(() => {
1313
initialAsyncId = async_hooks.executionAsyncId();
1414
async_hooks.createHook({
15-
after: common.mustCall(() => {}, 2)
15+
after: common.mustCall(2)
1616
}).enable();
1717
resolve();
1818
}, 0);

test/parallel/test-async-hooks-enable-disable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require('assert');
44
const async_hooks = require('async_hooks');
55

66
const hook = async_hooks.createHook({
7-
init: common.mustCall(() => {}, 1),
7+
init: common.mustCall(1),
88
before: common.mustNotCall(),
99
after: common.mustNotCall(),
1010
destroy: common.mustNotCall()

test/parallel/test-cluster-worker-kill-signal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ if (cluster.isWorker) {
4545
}, 1));
4646

4747
// Check if the cluster was killed as well
48-
cluster.on('exit', common.mustCall(() => {}, 1));
48+
cluster.on('exit', common.mustCall(1));
4949
}

test/parallel/test-common.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@ assert.throws(
7070
message: /^fhqwhgads$/
7171
});
7272

73-
const fnOnce = common.mustCall(() => {});
73+
const fnOnce = common.mustCall();
7474
fnOnce();
75-
const fnTwice = common.mustCall(() => {}, 2);
75+
const fnTwice = common.mustCall(2);
7676
fnTwice();
7777
fnTwice();
78-
const fnAtLeast1Called1 = common.mustCallAtLeast(() => {}, 1);
78+
const fnAtLeast1Called1 = common.mustCallAtLeast(1);
7979
fnAtLeast1Called1();
80-
const fnAtLeast1Called2 = common.mustCallAtLeast(() => {}, 1);
80+
const fnAtLeast1Called2 = common.mustCallAtLeast(1);
8181
fnAtLeast1Called2();
8282
fnAtLeast1Called2();
83-
const fnAtLeast2Called2 = common.mustCallAtLeast(() => {}, 2);
83+
const fnAtLeast2Called2 = common.mustCallAtLeast(2);
8484
fnAtLeast2Called2();
8585
fnAtLeast2Called2();
86-
const fnAtLeast2Called3 = common.mustCallAtLeast(() => {}, 2);
86+
const fnAtLeast2Called3 = common.mustCallAtLeast(2);
8787
fnAtLeast2Called3();
8888
fnAtLeast2Called3();
8989
fnAtLeast2Called3();

test/parallel/test-dgram-bind-fd.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const BUFFER_SIZE = 4096;
9595
assert.fail(err.message);
9696
});
9797

98-
socket.on('close', common.mustCall(() => {}));
98+
socket.on('close', common.mustCall());
9999
}));
100100

101101
receiver.on('message', common.mustCall((data, { address, port }) => {
@@ -109,7 +109,7 @@ const BUFFER_SIZE = 4096;
109109
assert.fail(err.message);
110110
});
111111

112-
receiver.on('close', common.mustCall(() => {}));
112+
receiver.on('close', common.mustCall());
113113
}
114114

115115
testWithOptions(true, true);

test/parallel/test-dns-get-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ const { Resolver } = require('dns');
77
const resolver = new Resolver();
88
assert(resolver.getServers().length > 0);
99
// return undefined
10-
resolver._handle.getServers = common.mustCall(() => {});
10+
resolver._handle.getServers = common.mustCall();
1111
assert.strictEqual(resolver.getServers().length, 0);

test/parallel/test-fs-stat.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ fs.stat(__filename, common.mustSucceed((s) => {
151151
});
152152

153153
// Should not throw an error
154-
fs.stat(__filename, undefined, common.mustCall(() => {}));
154+
fs.stat(__filename, undefined, common.mustCall());
155155

156156
fs.open(__filename, 'r', undefined, common.mustCall((err, fd) => {
157157
// Should not throw an error
158-
fs.fstat(fd, undefined, common.mustCall(() => {}));
158+
fs.fstat(fd, undefined, common.mustCall());
159159
}));
160160

161161
// Should not throw an error
162-
fs.lstat(__filename, undefined, common.mustCall(() => {}));
162+
fs.lstat(__filename, undefined, common.mustCall());

test/parallel/test-fs-watch-close-when-destroyed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ watcher.addListener('change', () => {
3737
fs.rmdirSync(root);
3838
// Wait for the listener to hit
3939
setTimeout(
40-
common.mustCall(() => {}),
40+
common.mustCall(),
4141
common.platformTimeout(100)
4242
);

test/parallel/test-http2-respond-with-file-connection-abort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => {
2323
const client = http2.connect(`http://localhost:${server.address().port}`);
2424
const req = client.request();
2525

26-
req.on('response', common.mustCall(() => {}));
26+
req.on('response', common.mustCall());
2727
req.once('data', common.mustCall(() => {
2828
net.Socket.prototype.destroy.call(client.socket);
2929
server.close();

0 commit comments

Comments
 (0)