Skip to content

Commit 79a277e

Browse files
addaleaxBridgeAR
authored andcommitted
test: improve test-worker-message-port-message-before-close
Replace a wrong comment with a correct assertion and await all async operations inside the async function. PR-URL: #29483 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 53f2371 commit 79a277e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-worker-message-port-message-before-close.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ async function test() {
2828
for (let i = 0; i < 10000; i++) {
2929
const { port1, port2 } = new MessageChannel();
3030
worker.postMessage({ port: port2 }, [ port2 ]);
31-
await once(port1, 'message'); // 'complexObject'
31+
assert.deepStrictEqual(await once(port1, 'message'), ['firstMessage']);
3232
assert.deepStrictEqual(await once(port1, 'message'), ['lastMessage']);
3333
}
3434

35-
worker.terminate();
35+
await worker.terminate();
3636
}
3737

3838
test().then(common.mustCall());

0 commit comments

Comments
 (0)