swc/wasm/__tests__/error.js
Donny/강동윤 2ca6e5d79b
feat(es/transforms/optimization): Support inlining of typeofs (#2473)
swc_ecma_transforms_optimization:
 - `inline_globals`: Support inlining of `typeof`s.

swc:
 - Change error message for parsing failure to mention `Syntax Error`.
2021-10-19 09:49:18 +00:00

12 lines
269 B
JavaScript

const swc = require("../pkg");
it("properly reports error", function () {
expect(() => {
swc.transformSync("Foo {}", {});
}).toThrow("Syntax Error");
expect(() => {
swc.transformSync("Foo {}", {});
}).toThrow("error: Expected ';', '}' or <eof>");
});