import { TemplateSet } from "../../src/compiler/template_helpers"; import { renderToString, TestContext, compile } from "../helpers"; // ----------------------------------------------------------------------------- // basic validation // ----------------------------------------------------------------------------- describe("basic validation", () => { test("error if no template with given name", () => { const context = new TemplateSet(); expect(() => context.getTemplate("invalidname")).toThrow("Missing template"); }); test("cannot add twice the same template", () => { const context = new TemplateSet(); expect(() => context.addTemplate("test", "
", { allowDuplicate: true })).not.toThrow( "already defined" ); expect(() => context.addTemplate("test", "")).toThrow("already defined"); }); test("invalid xml", () => { const template = "