pi-mono/packages/coding-agent/test/references.test.ts
Christian Klotz 8efd314fa3
docs(ai,coding-agent): generate models.json reference from schemas (#11038)
* docs(ai,coding-agent): generate models.json reference from schemas

Add npm run generate:references, which renders docs/models-configuration.md
from the models.json TypeBox schemas, and describe provider and model fields
in those schemas. Overrides get their own descriptions without defaults, and
compat sections cover the Responses API aliases.

closes #10790

* Modify changelog

* docs(ai,coding-agent): use shared thinkingLevelMap and promptCache schemas

Replace the per-use schema helpers with fixed schemas whose descriptions
hold for both models and modelOverrides entries.
2026-10-16 21:53:00 +01:00

17 lines
680 B
TypeScript

import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { renderReferences } from "../scripts/generate-references.ts";
describe("generated reference pages", () => {
// Regression for #10790: models.json fields lost their reference documentation.
it("matches the committed pages", () => {
const rendered = renderReferences();
expect([...rendered.keys()]).toEqual(["docs/models-configuration.md"]);
for (const [relativePath, expected] of rendered) {
expect(
readFileSync(new URL(`../${relativePath}`, import.meta.url), "utf-8"),
`${relativePath} is stale; run npm run generate:references`,
).toBe(expected);
}
});
});