Skip to content

Commit

Permalink
test: improve test-worker-message-port-message-before-close
Browse files Browse the repository at this point in the history
Replace a wrong comment with a correct assertion and await all async
operations inside the async function.

PR-URL: #29483
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
addaleax authored and BridgeAR committed Sep 25, 2019
1 parent 53f2371 commit 79a277e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ async function test() {
for (let i = 0; i < 10000; i++) {
const { port1, port2 } = new MessageChannel();
worker.postMessage({ port: port2 }, [ port2 ]);
await once(port1, 'message'); // 'complexObject'
assert.deepStrictEqual(await once(port1, 'message'), ['firstMessage']);
assert.deepStrictEqual(await once(port1, 'message'), ['lastMessage']);
}

worker.terminate();
await worker.terminate();
}

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

0 comments on commit 79a277e

Please sign in to comment.