Skip to content

Commit

Permalink
remove testing race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 4, 2019
1 parent 4a3ac07 commit dc94f82
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/moon/test/compiler/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test("parse nested elements", () => {
});
});

test("parse error from invalid view", () => {
test("parse errors in development", () => {
process.env.MOON_ENV = "development";
console.error = jest.fn();

Expand All @@ -100,6 +100,11 @@ test("parse error from invalid view", () => {
`).constructor.name).toBe("ParseError");
expect(console.error).toBeCalled();

expect(parseTest("").constructor.name).toBe("ParseError");
expect(console.error.mock.calls.length).toBe(2);
});

test("parse errors in production", () => {
process.env.MOON_ENV = "production";
console.error = jest.fn();

Expand All @@ -110,17 +115,6 @@ test("parse error from invalid view", () => {
</div>
`).constructor.name).toBe("ParseError");
expect(console.error).not.toBeCalled();
});

test("parse error from empty element", () => {
process.env.MOON_ENV = "development";
console.error = jest.fn();

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

process.env.MOON_ENV = "production";
console.error = jest.fn();

expect(parseTest("").constructor.name).toBe("ParseError");
expect(console.error).not.toBeCalled();
Expand Down

0 comments on commit dc94f82

Please sign in to comment.