test: describe plugin manifest migrations

This commit is contained in:
Shakker
2026-05-11 20:24:14 +01:00
parent 7def30cbb1
commit 2bb4e23ea1

View File

@@ -110,9 +110,21 @@ describe("doctor plugin manifest legacy contract repair", () => {
manifestRoots: [pluginsRoot],
});
expect(migrations).toHaveLength(1);
expect(migrations[0]?.changeLines).toEqual([
`- ${path.join(root, "openclaw.plugin.json")}: moved speechProviders to contracts.speechProviders`,
const manifestPath = path.join(root, "openclaw.plugin.json");
expect(migrations).toStrictEqual([
{
changeLines: [`- ${manifestPath}: moved speechProviders to contracts.speechProviders`],
manifestPath,
nextRaw: {
id: "openai",
providers: ["openai"],
contracts: {
speechProviders: ["openai"],
},
configSchema: { type: "object" },
},
pluginId: "openai",
},
]);
});
@@ -178,9 +190,21 @@ describe("doctor plugin manifest legacy contract repair", () => {
manifestRoots: [pluginsRoot],
});
expect(migrations).toHaveLength(1);
expect(migrations[0]?.nextRaw.contracts).toEqual({
speechProviders: ["openai"],
});
const manifestPath = path.join(root, "openclaw.plugin.json");
expect(migrations).toStrictEqual([
{
changeLines: [`- ${manifestPath}: moved speechProviders to contracts.speechProviders`],
manifestPath,
nextRaw: {
id: "openai",
providers: ["openai"],
contracts: {
speechProviders: ["openai"],
},
configSchema: { type: "object" },
},
pluginId: "openai",
},
]);
});
});