Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dbc696d

Browse filesBrowse files
TrottRafaelGSS
authored andcommitted
test: remove unnecessary noop function args to mustCall()
PR-URL: #45027 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 24e24bd commit dbc696d
Copy full SHA for dbc696d
Expand file treeCollapse file tree

22 files changed

+32
-32
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/async-hooks/test-late-hook-enable.js
+1-1Lines 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();
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-async-hooks-enable-before-promise-resolve.js
+1-1Lines 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);
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-async-hooks-enable-disable.js
+1-1Lines 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()
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-cluster-worker-kill-signal.js
+1-1Lines 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
}
Collapse file

‎test/parallel/test-common.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-common.js
+6-6Lines 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();
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-dgram-bind-fd.js
+2-2Lines 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);
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-dns-get-server.js
+1-1Lines 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);
Collapse file

‎test/parallel/test-fs-stat.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-stat.js
+3-3Lines 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());
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-fs-watch-close-when-destroyed.js
+1-1Lines 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
);
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-http2-respond-with-file-connection-abort.js
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.