oxc/tasks/transform_conformance
overlookmotel 21b08ba141 refactor(transformer): shared VarDeclarations (#6170)
First step towards #5049.

Various transforms need to add a `var` statement at top of enclosing statement block.

e.g.:

```js
// Input
a ??= b;
```

```js
// Output
var _a;
(_a = a) !== null && _a !== void 0 ? _a : (a = b);
```

Each of these transforms previously maintained it's own stack and added `var` statements individually.

Share this functionality in a "common" utility transform which maintains a single stack to serve them all.
2024-09-30 03:53:00 +00:00
..
snapshots refactor(transformer): shared VarDeclarations (#6170) 2024-09-30 03:53:00 +00:00
src test(transformer): join paths in cross-platform compatible way (#5920) 2024-09-20 11:30:12 +00:00
tests fix(transformer/react): should not collect use-hooks if it's a nested member expression (#6143) 2024-09-28 14:38:14 +00:00
Cargo.toml perf(rust): use cow_utils instead (#5664) 2024-09-11 18:39:30 +08:00
README.md test(transformer): update transform conformance README (#5919) 2024-09-20 11:46:44 +01:00

Transformation Conformance Test Runner

Execution

This test runner uses the transformation plugin test suite from the Babel repository.

Additional tests are in the tests directory.

The failing test cases are listed in:

To get started, run

cargo run -p oxc_transform_conformance

or watch for changes

just watch 'run -p oxc_transform_conformance'

Options

--filter

To filter for a specific test case, apply the --filter path option, e.g.

cargo run -p oxc_transform_conformance -- --filter react/arrow-functions

--exec

The Babel test suite contains many exec.js files, which need to be executed by a runtime.

bun is the preferred way to execute these tests, which you may install them via https://bun.sh/docs/installation.

Once bun is installed, apply the --exec flag:

cargo run -p oxc_transform_conformance -- --exec

The failing test cases are listed in babel_exec.snap.md.