test: clear object shape matcher scan · openclaw/openclaw@7c31a9a
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -673,8 +673,10 @@ describe("config cli", () => {
|
673 | 673 | properties?: Record<string, unknown>; |
674 | 674 | }; |
675 | 675 | expect(payload.properties?.$schema).toEqual({ type: "string" }); |
676 | | -expect(payload.properties?.channels).toBeTypeOf("object"); |
677 | | -expect(payload.properties?.channels).not.toBeNull(); |
| 676 | +expect(payload.properties?.channels).toMatchObject({ |
| 677 | +type: "object", |
| 678 | +properties: { telegram: { type: "object" } }, |
| 679 | +}); |
678 | 680 | expect(payload.properties?.plugins).toBeUndefined(); |
679 | 681 | expect(mockError).not.toHaveBeenCalled(); |
680 | 682 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -42,8 +42,9 @@ describe("ClawHub plugin docs", () => {
|
42 | 42 | |
43 | 43 | expect(validateExternalCodePluginPackageJson(packageJson).issues).toEqual([]); |
44 | 44 | expect(typeof pluginManifest.id).toBe("string"); |
45 | | -expect(pluginManifest.configSchema).toBeTypeOf("object"); |
| 45 | +expect(typeof pluginManifest.configSchema).toBe("object"); |
46 | 46 | expect(pluginManifest.configSchema).not.toBeNull(); |
| 47 | +expect(Array.isArray(pluginManifest.configSchema)).toBe(false); |
47 | 48 | }); |
48 | 49 | |
49 | 50 | it("does not tell plugin authors to use bare clawhub publish", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -47,7 +47,7 @@ function asRecord(value: unknown): Record<string, unknown> {
|
47 | 47 | } |
48 | 48 | |
49 | 49 | function expectRecord(value: unknown, label: string): Record<string, unknown> { |
50 | | -expect(value, label).toBeTypeOf("object"); |
| 50 | +expect(typeof value, label).toBe("object"); |
51 | 51 | expect(value, label).not.toBeNull(); |
52 | 52 | expect(Array.isArray(value), label).toBe(false); |
53 | 53 | return value as Record<string, unknown>; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,8 +88,10 @@ describe("gateway cli backend live helpers", () => {
|
88 | 88 | token: "gateway-token", |
89 | 89 | }); |
90 | 90 | |
91 | | -expect(client).toBeTypeOf("object"); |
| 91 | +expect(typeof client).toBe("object"); |
92 | 92 | expect(client).not.toBeNull(); |
| 93 | +expect(typeof (client as { start?: unknown }).start).toBe("function"); |
| 94 | +expect(typeof (client as { stopAndWait?: unknown }).stopAndWait).toBe("function"); |
93 | 95 | expect(gatewayClientState.lastOptions).toMatchObject({ |
94 | 96 | url: "ws://127.0.0.1:18789", |
95 | 97 | token: "gateway-token", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -454,8 +454,9 @@ 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).toBeTypeOf("object"); |
| 457 | +expect(typeof entry.manifest.configSchema).toBe("object"); |
458 | 458 | expect(entry.manifest.configSchema).not.toBeNull(); |
| 459 | +expect(Array.isArray(entry.manifest.configSchema)).toBe(false); |
459 | 460 | } |
460 | 461 | }); |
461 | 462 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。