test: tighten plugin contract assertions · openclaw/openclaw@a44021c
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -454,7 +454,8 @@ describe("bundled plugin metadata", () => {
|
454 | 454 | |
455 | 455 | it("keeps config schemas on all bundled plugin manifests", () => { |
456 | 456 | for (const entry of listRepoBundledPluginMetadata()) { |
457 | | -expect(entry.manifest.configSchema).toEqual(expect.any(Object)); |
| 457 | +expect(entry.manifest.configSchema).toBeTypeOf("object"); |
| 458 | +expect(entry.manifest.configSchema).not.toBeNull(); |
458 | 459 | } |
459 | 460 | }); |
460 | 461 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -228,7 +228,8 @@ describe("extension runtime dependency manifests", () => {
|
228 | 228 | it("keeps json5 in memory-core for packaged runtime config parsing", () => { |
229 | 229 | const manifest = readPackageManifest("extensions/memory-core/package.json"); |
230 | 230 | |
231 | | -expect(manifest.dependencies?.json5).toEqual(expect.any(String)); |
| 231 | +expect(manifest.dependencies?.json5).toBeTypeOf("string"); |
| 232 | +expect(manifest.dependencies?.json5).not.toBe(""); |
232 | 233 | }); |
233 | 234 | |
234 | 235 | for (const manifestPath of listPackageManifests(EXTENSION_ROOT)) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -659,7 +659,8 @@ describe("plugin-sdk package contract guardrails", () => {
|
659 | 659 | "fake-indexeddb", |
660 | 660 | "matrix-js-sdk", |
661 | 661 | ]) { |
662 | | -expect(matrixRuntimeDeps.get(dep)).toEqual(expect.any(String)); |
| 662 | +expect(matrixRuntimeDeps.get(dep)).toBeTypeOf("string"); |
| 663 | +expect(matrixRuntimeDeps.get(dep)).not.toBe(""); |
663 | 664 | expect(rootRuntimeDeps.has(dep)).toBe(false); |
664 | 665 | } |
665 | 666 | expect(rootRuntimeDeps.has("@openclaw/plugin-package-contract")).toBe(false); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -301,7 +301,7 @@ function expectFailedInstallResult<
|
301 | 301 | if (params.code) { |
302 | 302 | expect(params.result.code).toBe(params.code); |
303 | 303 | } |
304 | | -expect(params.result.error).toEqual(expect.any(String)); |
| 304 | +expect(params.result.error).toBeTypeOf("string"); |
305 | 305 | params.messageIncludes.forEach((fragment) => { |
306 | 306 | expect(params.result.error).toContain(fragment); |
307 | 307 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。