fix: harden plugin install and uninstall transactions

This commit is contained in:
Peter Steinberger
2026-04-26 10:27:15 +01:00
parent 893f070560
commit 6bc5fe6952
15 changed files with 490 additions and 218 deletions

View File

@@ -21,6 +21,7 @@ import {
recordHookInstall,
recordPluginInstall,
resetPluginsCliTestState,
replaceConfigFile,
runPluginsCommand,
runtimeErrors,
runtimeLogs,
@@ -336,6 +337,12 @@ describe("plugins cli install", () => {
}),
});
expect(writeConfigFile).toHaveBeenCalledWith(enabledCfg);
expect(replaceConfigFile).toHaveBeenCalledWith(
expect.objectContaining({
baseHash: "mock",
nextConfig: enabledCfg,
}),
);
expect(runtimeLogs.some((line) => line.includes("slot adjusted"))).toBe(true);
expect(runtimeLogs.some((line) => line.includes("Installed plugin: alpha"))).toBe(true);
});