release: WRNexusJS 0.3.5
This commit is contained in:
@@ -92,3 +92,17 @@ test("parses keyed each blocks without changing legacy loop syntax", () => {
|
||||
expect.objectContaining({ type: "each", key: undefined }),
|
||||
);
|
||||
});
|
||||
|
||||
test("parses public component event declarations inside props", () => {
|
||||
const ast = parse(`component SearchBox {
|
||||
props {
|
||||
value = ""
|
||||
@event search = function
|
||||
@event clear = function
|
||||
}
|
||||
view { <input value="{value}" /> }
|
||||
}`);
|
||||
|
||||
expect(ast.props.map((prop) => prop.name)).toEqual(["value"]);
|
||||
expect(ast.events).toEqual([{ name: "search" }, { name: "clear" }]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user