Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
worker: add mustCall to the event to ensure the assert will be called…
… in order
  • Loading branch information
ErickWendel committed Feb 1, 2022
commit 0bceab4293b766b2093f4bbd699490fef81c1269
4 changes: 2 additions & 2 deletions test/parallel/test-worker-heap-snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ const worker = new Worker(__filename);
const snapShotResult = { ondone: () => {} };
worker[kHandle].takeHeapSnapshot = common.mustCall(() => snapShotResult);

worker.on('online', () => {
worker.on('online', common.mustCall(() => {
const snapShotResponse = worker.getHeapSnapshot();
snapShotResult.ondone({});

snapShotResponse.then(common.mustCall((heapSnapshotStream) => {
assert.ok(heapSnapshotStream instanceof HeapSnapshotStream);
Comment thread
ErickWendel marked this conversation as resolved.
Outdated
worker.terminate();
}));
});
}));