Skip to content

Commit 24a20eb

Browse files
committed
test(apple): cover cancellation after reinstall preparation
1 parent 88bfc20 commit 24a20eb

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎packages/platform-apple/src/deployment/runtime.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,21 @@ test('reinstall keeps the installed app when cancelled during preparation', asyn
601601
expect(events).toEqual(['prepare']);
602602
});
603603

604+
test('reinstall releases the prepared replacement when cancelled after preparation', async () => {
605+
const controller = new AbortController();
606+
const cancellation = new Error('cancelled after preparation');
607+
const { events, reinstall } = reinstallHarness({
608+
signal: controller.signal,
609+
prepare: async () => {
610+
controller.abort(cancellation);
611+
},
612+
});
613+
614+
await expect(reinstall()).rejects.toBe(cancellation);
615+
616+
expect(events).toEqual(['prepare', 'cleanup']);
617+
});
618+
604619
test('reinstall releases the prepared replacement when uninstall fails', async () => {
605620
const { events, reinstall } = reinstallHarness({ uninstallExitCode: 1 });
606621

0 commit comments

Comments
 (0)