Skip to content

Commit c8d2556

Browse files
committed
Fix unittestcli failure
1 parent b2ad652 commit c8d2556

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/unit/api_spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,14 @@ describe("api", function () {
197197
expect(loadingTask instanceof PDFDocumentLoadingTask).toEqual(true);
198198
// This can be somewhat random -- we cannot guarantee perfect
199199
// 'Terminate' message to the worker before/after setting up pdfManager.
200+
const loadingTaskPromise = loadingTask.promise.catch(() => {
201+
// Shouldn't get here.
202+
});
200203
const destroyed = loadingTask._worker.promise.then(() =>
201204
loadingTask.destroy()
202205
);
203206

204-
await destroyed;
207+
await Promise.all([destroyed, loadingTaskPromise]);
205208
expect(true).toEqual(true);
206209
});
207210

0 commit comments

Comments
 (0)