test: clear object shape matcher scan

This commit is contained in:
Peter Steinberger
2026-05-08 15:23:09 +01:00
parent b7033369a6
commit 7c31a9aafc
5 changed files with 12 additions and 6 deletions

View File

@@ -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();
});

View File

@@ -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 () => {

View File

@@ -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>;

View File

@@ -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",

View File

@@ -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);
}
});