mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
chore: add itLte to repo-utils
test(core): update require(ESM) test fixtures
update node-flags-with-value.json
add node 23 test job
add node 23 to ESM test
ci: move env config to the step
try to remove node options from cjs build tests
fix: pass through process env in register tests
try to inline NODE_OPTIONS env
test: remove special handling of the BABEL_8_BREAKING env
fix undeclared dev deps
fix: default externalHelpers to true
Previously we try to resolve "@babel/plugin-external-helpers", but this package is never listed in the dependencies of babel-helper-fixtures, and any other babel plugins that used babel-helper-fixtures. Since we resolve external-helpers by the monorepo library path, it is not necessary to actually resolve @babel/plugin-external-helpers.
test: improve "options merge backwards" test
This test was introduced in 2bdc222c0b, the motivation is to ensure that plugins is applied before presets.
test: avoid @babel/preset-react self-reference
specify babel-eslint-tests dependency
specify babel-node test dependency
fix: directory import is not supported in node < 23
pass through process env in spawnNodeAsync tests
use --disable-warning on node 23 only
31 lines
914 B
JavaScript
31 lines
914 B
JavaScript
import { transformSync } from "@babel/core";
|
|
import proposalDestructuringPrivate from "../lib/index.js";
|
|
import transformClassProperties from "@babel/plugin-transform-class-properties";
|
|
import transformClassStaticBlock from "@babel/plugin-transform-class-static-block";
|
|
|
|
describe("plugin ordering", () => {
|
|
it("should work when @babel/plugin-proposal-destructuring-private is after class features plugin", () => {
|
|
const source = `class Foo {
|
|
static #x = 1;
|
|
static {
|
|
const {#x: x } = Foo;
|
|
};
|
|
}
|
|
`;
|
|
expect(
|
|
() =>
|
|
transformSync(source, {
|
|
filename: "example.js",
|
|
highlightCode: false,
|
|
configFile: false,
|
|
babelrc: false,
|
|
plugins: [
|
|
transformClassProperties,
|
|
transformClassStaticBlock,
|
|
proposalDestructuringPrivate,
|
|
],
|
|
}).code,
|
|
).not.toThrow();
|
|
});
|
|
});
|