Skip to content

Commit 1da674e

Browse files
Trottjasnell
authored andcommitted
test: check number of message events
When a no-op message event handler is used in a test, make it clear what is expected by using `common.mustCall()` and `common.mustNotCall()`. PR-URL: #13125 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 4ccfd7c commit 1da674e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/parallel/test-child-process-fork-ref2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (process.argv[2] === 'child') {
2929

3030
setTimeout(function() {
3131
console.log('child -> will this keep it alive?');
32-
process.on('message', common.noop);
32+
process.on('message', common.mustNotCall());
3333
}, 400);
3434

3535
} else {

test/sequential/test-child-process-pass-fd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if (process.argv[2] !== 'child') {
4545
// the only thing keeping this worker alive will be IPC. This is important,
4646
// because it means a worker with no parent will have no referenced handles,
4747
// thus no work to do, and will exit immediately, preventing process leaks.
48-
process.on('message', common.noop);
48+
process.on('message', common.mustCall());
4949

5050
const server = net.createServer((c) => {
5151
process.once('message', function(msg) {

0 commit comments

Comments
 (0)