Skip to content

Commit 1684766

Browse files
committed
test(harmonyos): cover the unverifiable post-uninstall dump branch
1 parent 122bb4a commit 1684766

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,21 @@ test.each([
261261
},
262262
);
263263

264+
test('uninstall refuses to claim removal when the post-uninstall dump cannot be verified', async () => {
265+
const run = vi.fn(
266+
scriptAnswers([installedDump, emptyAnswer, absentBundleAnswer, unreachableAnswer]),
267+
);
268+
const commands = { which: async () => undefined, run } as HostCommandRunner;
269+
const signal = new AbortController().signal;
270+
const operations = createHarmonyAppDeploymentOperations({ commands, device, signal });
271+
272+
await expect(operations.uninstallApp?.({ app: 'com.example.app' })).rejects.toMatchObject({
273+
code: 'COMMAND_FAILED',
274+
message: 'Could not verify the uninstall of com.example.app',
275+
});
276+
expect(run).toHaveBeenCalledTimes(4);
277+
});
278+
264279
test('uninstall refuses a blank bundle name', async () => {
265280
const run = vi.fn();
266281
const commands = { which: async () => undefined, run } as HostCommandRunner;

0 commit comments

Comments
 (0)