Skip to content

Commit 307eaca

Browse files
authored
test: ensure that the message event is fired
Use `common.mustCallAtLeast()` to verify that the `'message'` event is fired. PR-URL: #59952 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
1 parent eaf6d49 commit 307eaca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-worker-message-port-infinite-message-loop.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { MessageChannel } = require('worker_threads');
1111

1212
const { port1, port2 } = new MessageChannel();
1313
let count = 0;
14-
port1.on('message', () => {
14+
port1.on('message', common.mustCallAtLeast(() => {
1515
if (count === 0) {
1616
setTimeout(common.mustCall(() => {
1717
port1.close();
@@ -20,7 +20,7 @@ port1.on('message', () => {
2020

2121
port2.postMessage(0);
2222
assert(count++ < 10000, `hit ${count} loop iterations`);
23-
});
23+
}));
2424

2525
port2.postMessage(0);
2626

0 commit comments

Comments
 (0)