From a67db5c36763c98edcef4dac4bf8145d2edf47b9 Mon Sep 17 00:00:00 2001 From: Qiuner Date: Wed, 19 Aug 2026 18:31:08 +0800 Subject: [PATCH] test(desktop): verify plugin install lifecycle contract --- dsh-plugin-desktop/scripts/verify-profile-boot.mjs | 6 +++++- .../fixtures/desktop-host-services-smoke-plugin/index.js | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dsh-plugin-desktop/scripts/verify-profile-boot.mjs b/dsh-plugin-desktop/scripts/verify-profile-boot.mjs index 99ebe9794b..db4a48805d 100644 --- a/dsh-plugin-desktop/scripts/verify-profile-boot.mjs +++ b/dsh-plugin-desktop/scripts/verify-profile-boot.mjs @@ -185,7 +185,11 @@ try { || hostServiceProbe.pnpm?.serviceName !== 'desktopPnpm' || hostServiceProbe.pnpm.lookupRun !== 'function' || hostServiceProbe.pnpm.run !== 'function' - || hostServiceProbe.pnpm.runPlugin !== 'function') { + || hostServiceProbe.pnpm.runPlugin !== 'function' + || hostServiceProbe.pnpm.installPlugin !== 'function' + || hostServiceProbe.pnpm.recoveredInstallReceiptIds !== 'function' + || hostServiceProbe.pnpm.acknowledgeRecoveredInstall !== 'function' + || hostServiceProbe.pnpm.rollbackPluginInstall !== 'function') { throw new Error( `profile-local Host service plugin produced an unexpected probe: ${JSON.stringify(hostServiceProbe)}`, ) diff --git a/dsh-plugin-desktop/tests/fixtures/desktop-host-services-smoke-plugin/index.js b/dsh-plugin-desktop/tests/fixtures/desktop-host-services-smoke-plugin/index.js index cda1daf5dd..0844d284f9 100644 --- a/dsh-plugin-desktop/tests/fixtures/desktop-host-services-smoke-plugin/index.js +++ b/dsh-plugin-desktop/tests/fixtures/desktop-host-services-smoke-plugin/index.js @@ -16,6 +16,10 @@ export function apply(ctx) { lookupRun: typeof ctx.get('desktopPnpm')?.run, run: typeof pnpm.run, runPlugin: typeof pnpm.runPlugin, + installPlugin: typeof pnpm.installPlugin, + recoveredInstallReceiptIds: typeof pnpm.recoveredInstallReceiptIds, + acknowledgeRecoveredInstall: typeof pnpm.acknowledgeRecoveredInstall, + rollbackPluginInstall: typeof pnpm.rollbackPluginInstall, }), })) }