fix(core): keep unset values visible in prose (#12)
renderText now leaves {{name}} in place when the value is empty, so prose
shows which parameter is still missing instead of a blank.
This commit is contained in:
@@ -153,6 +153,8 @@ describe("rendering and secrets", () => {
|
||||
it("renders prose with raw values and handles inherited names safely", () => {
|
||||
const n = book(" x: {type: string}");
|
||||
expect(renderText("{{x}} {{toString}}", { x: "a & b" }, n)).toBe("a & b {{toString}}");
|
||||
// An unset value stays visible as its template instead of vanishing ("on ****").
|
||||
expect(renderText("on **{{x}}**", { x: "" }, n)).toBe("on **{{x}}**");
|
||||
expect(render(n, {}, {}).invalid.x).toBeUndefined();
|
||||
expect(render(n, {}, {}).missing).toContain("x");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user