swc/node-swc/__tests__/minify/issue_6996_test.mjs

16 lines
416 B
JavaScript

import swc from "../../..";
it("should not throw when keep_fnames is on", async () => {
async function minify() {
const { code } = await swc.transform('function Foo() {}', {
jsc: {
minify: {
keep_fnames: true,
},
},
});
return code;
}
await expect(minify()).resolves.toEqual('function Foo() {}\n');
});