import { describe, expect, it, vi } from "vitest"; import { z } from "zod"; import { buildChannelConfigSchema, emptyChannelConfigSchema } from "./config-schema.js";
describe("buildChannelConfigSchema", () => {
it("builds json schema when toJSONSchema is available", () => { const schema = z.object({ enabled: z.boolean().default(true) }); const result = buildChannelConfigSchema(schema);
expect(result.schema).toMatchObject({ type: "object" });
});
it("falls back when toJSONSchema is missing (zod v3 plugin compatibility)", () => { const legacySchema = {} as unknown as Parameters<typeof buildChannelConfigSchema>[0]; const result = buildChannelConfigSchema(legacySchema);
expect(result.schema).toEqual({ type: "object", additionalProperties: true });
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.