Skip to content

Commit

Permalink
update tests for parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 4, 2019
1 parent adf54c6 commit 7d93cef
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/moon/test/compiler/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,20 @@ test("parse nested elements", () => {
});

test("parse error from invalid view", () => {
console.error = jest.fn();

expect(parseTest(`
<div>
<p>text?
</h1></input>
</div>
`)).toBe(null);
`).constructor.name).toBe("ParseError");
expect(console.error).toBeCalled();
});

test("parse error from empty element", () => {
expect(parseTest("")).toBe(null);
console.error = jest.fn();

expect(parseTest("").constructor.name).toBe("ParseError");
expect(console.error).toBeCalled();
});

0 comments on commit 7d93cef

Please sign in to comment.