From cd98df601c42de875a2f56e4c116f497e010fe9e Mon Sep 17 00:00:00 2001 From: Shakker Date: Tue, 12 May 2026 21:02:10 +0100 Subject: [PATCH] test: compel uninstall plan params --- src/cli/plugins-cli.uninstall.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cli/plugins-cli.uninstall.test.ts b/src/cli/plugins-cli.uninstall.test.ts index f7dcc9101fb..3a484a03e6c 100644 --- a/src/cli/plugins-cli.uninstall.test.ts +++ b/src/cli/plugins-cli.uninstall.test.ts @@ -36,11 +36,13 @@ function expectLatestUninstallPlanParams(expected: { const params = planPluginUninstall.mock.calls.at(-1)?.[0] as | { pluginId?: string; deleteFiles?: boolean; channelIds?: unknown } | undefined; - expect(params).toBeDefined(); - expect(params?.pluginId).toBe(expected.pluginId); - expect(params?.deleteFiles).toBe(expected.deleteFiles); + if (params === undefined) { + throw new Error("expected latest plugin uninstall plan params"); + } + expect(params.pluginId).toBe(expected.pluginId); + expect(params.deleteFiles).toBe(expected.deleteFiles); if ("channelIds" in expected) { - expect(params?.channelIds).toBe(expected.channelIds); + expect(params.channelIds).toBe(expected.channelIds); } }