mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 01:20:43 +00:00
test: clear object shape matcher scan
This commit is contained in:
@@ -673,8 +673,10 @@ describe("config cli", () => {
|
||||
properties?: Record<string, unknown>;
|
||||
};
|
||||
expect(payload.properties?.$schema).toEqual({ type: "string" });
|
||||
expect(payload.properties?.channels).toBeTypeOf("object");
|
||||
expect(payload.properties?.channels).not.toBeNull();
|
||||
expect(payload.properties?.channels).toMatchObject({
|
||||
type: "object",
|
||||
properties: { telegram: { type: "object" } },
|
||||
});
|
||||
expect(payload.properties?.plugins).toBeUndefined();
|
||||
expect(mockError).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -42,8 +42,9 @@ describe("ClawHub plugin docs", () => {
|
||||
|
||||
expect(validateExternalCodePluginPackageJson(packageJson).issues).toEqual([]);
|
||||
expect(typeof pluginManifest.id).toBe("string");
|
||||
expect(pluginManifest.configSchema).toBeTypeOf("object");
|
||||
expect(typeof pluginManifest.configSchema).toBe("object");
|
||||
expect(pluginManifest.configSchema).not.toBeNull();
|
||||
expect(Array.isArray(pluginManifest.configSchema)).toBe(false);
|
||||
});
|
||||
|
||||
it("does not tell plugin authors to use bare clawhub publish", async () => {
|
||||
|
||||
@@ -47,7 +47,7 @@ function asRecord(value: unknown): Record<string, unknown> {
|
||||
}
|
||||
|
||||
function expectRecord(value: unknown, label: string): Record<string, unknown> {
|
||||
expect(value, label).toBeTypeOf("object");
|
||||
expect(typeof value, label).toBe("object");
|
||||
expect(value, label).not.toBeNull();
|
||||
expect(Array.isArray(value), label).toBe(false);
|
||||
return value as Record<string, unknown>;
|
||||
|
||||
@@ -88,8 +88,10 @@ describe("gateway cli backend live helpers", () => {
|
||||
token: "gateway-token",
|
||||
});
|
||||
|
||||
expect(client).toBeTypeOf("object");
|
||||
expect(typeof client).toBe("object");
|
||||
expect(client).not.toBeNull();
|
||||
expect(typeof (client as { start?: unknown }).start).toBe("function");
|
||||
expect(typeof (client as { stopAndWait?: unknown }).stopAndWait).toBe("function");
|
||||
expect(gatewayClientState.lastOptions).toMatchObject({
|
||||
url: "ws://127.0.0.1:18789",
|
||||
token: "gateway-token",
|
||||
|
||||
@@ -454,8 +454,9 @@ describe("bundled plugin metadata", () => {
|
||||
|
||||
it("keeps config schemas on all bundled plugin manifests", () => {
|
||||
for (const entry of listRepoBundledPluginMetadata()) {
|
||||
expect(entry.manifest.configSchema).toBeTypeOf("object");
|
||||
expect(typeof entry.manifest.configSchema).toBe("object");
|
||||
expect(entry.manifest.configSchema).not.toBeNull();
|
||||
expect(Array.isArray(entry.manifest.configSchema)).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user