fix compiler authoring traps and showcase generation order
This commit is contained in:
@@ -1499,3 +1499,24 @@ test("a boolean attribute bound to a loop variable binds on the client", () => {
|
||||
expect(code).not.toContain('__wireBooleanAttr("checked"');
|
||||
expect(code).toContain("data-wrn-bind-");
|
||||
});
|
||||
|
||||
test("block comments inside props report the authoring restriction", () => {
|
||||
expect(() =>
|
||||
compileWireFile(`component Example {
|
||||
props {
|
||||
/* use a line comment */
|
||||
label: string = "Example"
|
||||
}
|
||||
view { <span>{label}</span> }
|
||||
}`),
|
||||
).toThrow("Block comments are not allowed inside props {}; use // line comments instead");
|
||||
});
|
||||
|
||||
test("state page reports its collision with the page keyword", () => {
|
||||
expect(() =>
|
||||
compileWireFile(`page Example {
|
||||
state page = 1
|
||||
view { <span>{page}</span> }
|
||||
}`),
|
||||
).toThrow("State name 'page' collides with the WRN 'page' keyword");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user