Skip to content

Commit dbe3343

Browse files
author
codeErrorSleep
committed
fix(test): fix the type safe call of resolveInstall in the updater unit test
1 parent bbb4145 commit dbe3343

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/services/updater.unit.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ describe("updater startBackgroundInstall", () => {
9595
};
9696

9797
await waitForResolve();
98-
resolveInstall?.();
98+
const finishInstall = resolveInstall as (() => void) | null;
99+
if (!finishInstall) {
100+
throw new Error("downloadAndInstall resolver was not captured");
101+
}
102+
finishInstall();
99103
const completion = await updater.waitForInstallCompletion();
100104
expect(completion?.state).toBe("ready_to_restart");
101105
});

0 commit comments

Comments
 (0)