mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
Replace empty tuples with a shared empty-array schema. Validate all input and output schemas against Draft 2020-12 during catalog generation and packaged MCP verification, with runtime and catalog regression coverage. Closes #528 Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
22 lines
469 B
TypeScript
22 lines
469 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { emptyArraySchema } from "./emptyArraySchema.js";
|
|
|
|
describe("empty array schema", () => {
|
|
it("accepts only an empty array", () => {
|
|
expect(emptyArraySchema.parse([])).toEqual([]);
|
|
for (const value of [
|
|
[null],
|
|
["candidate"],
|
|
[0],
|
|
[false],
|
|
[{}],
|
|
[[]],
|
|
null,
|
|
{},
|
|
]) {
|
|
expect(emptyArraySchema.safeParse(value).success).toBe(false);
|
|
}
|
|
});
|
|
});
|