fix(cli): trim plugin preloads for setup-safe commands

This commit is contained in:
Peter Steinberger
2026-04-25 23:05:45 +01:00
parent 8d08e86f42
commit cf303b3101
8 changed files with 176 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ vi.mock("../../../globals.js", () => ({
vi.mock("../../plugin-registry.js", () => ({
ensurePluginRegistryLoaded: vi.fn(),
}));
const { ensurePluginRegistryLoaded } = await import("../../plugin-registry.js");
const hasHooksMock = vi.fn((_hookName: string) => false);
const runGatewayStopMock = vi.fn(
@@ -95,6 +96,7 @@ describe("runMessageAction", () => {
it("calls exit(0) after successful message delivery", async () => {
await runSendAction();
expect(ensurePluginRegistryLoaded).toHaveBeenCalledOnce();
expect(exitMock).toHaveBeenCalledOnce();
expect(exitMock).toHaveBeenCalledWith(0);
});