swc/wasm/__tests__/error.js

12 lines
279 B
JavaScript
Raw Normal View History

2020-05-07 12:17:57 +03:00
const swc = require("../pkg");
it("properly reports error", function () {
expect(() => {
swc.transformSync("Foo {}", {});
}).toThrow("failed to parse module");
2020-05-07 12:17:57 +03:00
expect(() => {
swc.transformSync("Foo {}", {});
}).toThrow("error: Expected ';', '}' or <eof>");
});