mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 23:00:43 +00:00
test: cover ClawHub plugin install uninstall
This commit is contained in:
@@ -688,6 +688,10 @@ export function registerPluginsCli(program: Command) {
|
||||
nextConfig,
|
||||
...(snapshot.hash !== undefined ? { baseHash: snapshot.hash } : {}),
|
||||
});
|
||||
const directoryResult = await applyPluginUninstallDirectoryRemoval(plan.directoryRemoval);
|
||||
for (const warning of directoryResult.warnings) {
|
||||
defaultRuntime.log(theme.warn(warning));
|
||||
}
|
||||
await refreshPluginRegistryAfterConfigMutation({
|
||||
config: nextConfig,
|
||||
reason: "source-changed",
|
||||
@@ -696,10 +700,6 @@ export function registerPluginsCli(program: Command) {
|
||||
warn: (message) => defaultRuntime.log(theme.warn(message)),
|
||||
},
|
||||
});
|
||||
const directoryResult = await applyPluginUninstallDirectoryRemoval(plan.directoryRemoval);
|
||||
for (const warning of directoryResult.warnings) {
|
||||
defaultRuntime.log(theme.warn(warning));
|
||||
}
|
||||
|
||||
const removed = formatUninstallActionLabels({
|
||||
...plan.actions,
|
||||
|
||||
@@ -258,8 +258,11 @@ describe("plugins cli uninstall", () => {
|
||||
const configWriteOrder = writeConfigFile.mock.invocationCallOrder[0] ?? 0;
|
||||
const deleteOrder =
|
||||
applyPluginUninstallDirectoryRemoval.mock.invocationCallOrder[0] ?? Number.MAX_SAFE_INTEGER;
|
||||
const refreshOrder =
|
||||
refreshPluginRegistry.mock.invocationCallOrder[0] ?? Number.MAX_SAFE_INTEGER;
|
||||
expect(configWriteOrder).toBeGreaterThan(0);
|
||||
expect(deleteOrder).toBeGreaterThan(configWriteOrder);
|
||||
expect(refreshOrder).toBeGreaterThan(deleteOrder);
|
||||
expect(applyPluginUninstallDirectoryRemoval).toHaveBeenCalledWith({
|
||||
target: ALPHA_INSTALL_PATH,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user