From 2bb4e23ea1dabb9e4a993d60eb8b54c91b37b852 Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 20:24:14 +0100 Subject: [PATCH] test: describe plugin manifest migrations --- src/commands/doctor-plugin-manifests.test.ts | 38 ++++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/commands/doctor-plugin-manifests.test.ts b/src/commands/doctor-plugin-manifests.test.ts index 813ae8ee905..e84c0df8433 100644 --- a/src/commands/doctor-plugin-manifests.test.ts +++ b/src/commands/doctor-plugin-manifests.test.ts @@ -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", + }, + ]); }); });