mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-17 09:00:43 +00:00
fix(plugins): sync official plugin installs during update (#78065)
* fix(plugins): sync official npm installs during update * fix(plugins): sync official clawhub installs during update * test(update): mock official plugin sync helpers --------- Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
This commit is contained in:
@@ -168,6 +168,8 @@ vi.mock("../utils.js", async (importOriginal) => {
|
||||
});
|
||||
|
||||
vi.mock("../plugins/update.js", () => ({
|
||||
resolveTrustedSourceLinkedOfficialClawHubSpec: vi.fn(() => undefined),
|
||||
resolveTrustedSourceLinkedOfficialNpmSpec: vi.fn(() => undefined),
|
||||
syncPluginsForUpdateChannel: (...args: unknown[]) => syncPluginsForUpdateChannel(...args),
|
||||
updateNpmInstalledPlugins: (...args: unknown[]) => updateNpmInstalledPlugins(...args),
|
||||
}));
|
||||
@@ -2439,13 +2441,14 @@ describe("update-cli", () => {
|
||||
| OpenClawConfig
|
||||
| undefined;
|
||||
const updateCall = vi.mocked(updateNpmInstalledPlugins).mock.calls[0]?.[0] as
|
||||
| { skipDisabledPlugins?: boolean }
|
||||
| { skipDisabledPlugins?: boolean; syncOfficialPluginInstalls?: boolean }
|
||||
| undefined;
|
||||
expect(syncConfig?.plugins?.installs).toEqual(pluginInstallRecords);
|
||||
expect(syncConfig?.update?.channel).toBe("beta");
|
||||
expect(syncConfig?.gateway?.auth).toBeUndefined();
|
||||
expect(syncConfig?.plugins?.entries).toBeUndefined();
|
||||
expect(updateCall?.skipDisabledPlugins).toBe(true);
|
||||
expect(updateCall?.syncOfficialPluginInstalls).toBe(true);
|
||||
});
|
||||
|
||||
it("persists channel and runs post-update work after switching from package to git", async () => {
|
||||
|
||||
Reference in New Issue
Block a user