mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 07:02:28 +03:00
32 lines
830 B
JavaScript
32 lines
830 B
JavaScript
import swc from "../../..";
|
|
|
|
describe("when jsc.experimentalDisableBuiltinTransforms is true", () => {
|
|
it("should preserve TypeScript", async () => {
|
|
const { code } = await swc.transform(
|
|
`
|
|
const hello: Type = () => {
|
|
console.log('hello');
|
|
};
|
|
`,
|
|
{
|
|
jsc: {
|
|
parser: {
|
|
syntax: "typescript",
|
|
},
|
|
experimental: {
|
|
disableBuiltinTransformsForInternalTesting: true,
|
|
},
|
|
},
|
|
minify: false,
|
|
}
|
|
);
|
|
|
|
expect(code).toMatchInlineSnapshot(`
|
|
"const hello: Type = ()=>{
|
|
console.log(\\"hello\\");
|
|
};
|
|
"
|
|
`);
|
|
});
|
|
});
|