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 831a0d3

Browse filesBrowse files
lpincatargos
authored andcommitted
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 <duhamelantoine1995@gmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
1 parent 1ca116a commit 831a0d3
Copy full SHA for 831a0d3

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

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

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

Copy file name to clipboardExpand all lines: test/parallel/test-worker-message-port-infinite-message-loop.js
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.