test(cli): verify marketplace shorthand through command (#123883)

This commit is contained in:
Peter Steinberger
2026-08-14 16:34:10 -07:00
committed by GitHub
parent 2ce443d9a4
commit bc66c1731f
+9 -13
View File
@@ -18,7 +18,6 @@ import {
runtimeErrors,
configWriteMock,
} from "./plugins-cli-test-helpers.js";
import { resolvePluginInstallPreflight } from "./plugins-install-preflight.js";
const { withPluginLifecycleLeaseMock } = vi.hoisted(() => ({
withPluginLifecycleLeaseMock: vi.fn(),
@@ -62,19 +61,16 @@ describe("plugin install mutation-free preflight", () => {
});
await expect(
resolvePluginInstallPreflight({
raw: "superpowers@claude-plugins-official",
allowInstallPolicyWarningPrompt: false,
opts: { force: true },
}),
).resolves.toMatchObject({
ok: true,
raw: "superpowers",
marketplace: "claude-plugins-official",
sourcePlan: null,
});
runPluginsCommand(["plugins", "install", "superpowers@claude-plugins-official", "--force"]),
).rejects.toThrow("__exit__:1");
expectNoPluginInstallSideEffects();
expect(installPluginFromMarketplaceMock).toHaveBeenCalledWith(
expect.objectContaining({
marketplace: "claude-plugins-official",
plugin: "superpowers",
}),
);
expect(installPluginFromNpmSpecMock).not.toHaveBeenCalled();
});
it.each([