| 1 |
import { transformSync } from "@babel/core"; |
| 2 |
import proposalDestructuringPrivate from "../lib/index.js"; |
| 3 |
import proposalClassProperties from "@babel/plugin-proposal-class-properties"; |
| 4 |
import proposalClassStaticBlock from "@babel/plugin-proposal-class-static-block"; |
| 5 |
|
| 6 |
describe("plugin ordering", () => { |
| 7 |
it("should work when @babel/plugin-proposal-destructuring-private is after class features plugin", () => { |
| 8 |
const source = `class Foo { |
| 9 |
static #x = 1; |
| 10 |
static { |
| 11 |
const {#x: x } = Foo; |
| 12 |
}; |
| 13 |
} |
| 14 |
`; |
| 15 |
expect( |
| 16 |
() => |
| 17 |
transformSync(source, { |
| 18 |
filename: "example.js", |
| 19 |
highlightCode: false, |
| 20 |
configFile: false, |
| 21 |
babelrc: false, |
| 22 |
plugins: [ |
| 23 |
proposalClassProperties, |
| 24 |
proposalClassStaticBlock, |
| 25 |
proposalDestructuringPrivate, |
| 26 |
], |
| 27 |
}).code, |
| 28 |
).not.toThrow(); |
| 29 |
}); |
| 30 |
}); |