Latest Results
refactor(es/transforms/react): organize transform tests as fixtures (#12662)
**Description:**
Move React transform output tests from inline Rust and snapshot files
into input/output fixture directories, organized by transform. This
makes each case and its expected output easier to find and review.
- Run the cases that match the React preset through one
`tests/preset.rs` harness. `options.json` contains the
`jsc.transform.react` portion of `.swcrc`; parent directory options are
inherited and a case can override them. For example,
`tests/preset/jsx/react/options.json` selects `{ "runtime": "classic" }`
for its cases, and `tests/preset/refresh/javascript/options.json`
enables development and full refresh signatures.
- Keep cases requiring a different pipeline in `tests/custom.rs` and
`tests/custom/`. For example, the arrow-functions case needs the arrow
transform, and refresh-only cases must retain JSX rather than running
the whole React preset. Existing diagnostics, script, ignored,
TypeScript, and ES3 cases stay in their respective custom flows.
- Keep internal helper unit tests, move single-file modules out of their
`mod.rs` directories, and document the fixture convention in the crate's
`AGENTS.md`.
Test inventory was checked with `cargo test -p swc_ecma_transforms_react
-- --list`: **342 tests before and 342 after**. After the move, the
default run has 5 helper unit tests, 224 preset fixtures, and 113 custom
fixtures; 297 pass and 45 remain ignored. With `--features es3`, the
additional feature-gated fixture makes 343 tests (298 pass, 45 ignored).
Validation:
- `cargo fmt --all`
- `cargo clippy --all --all-targets -- -D warnings`
- `cargo test -p swc_ecma_transforms_react`
- `cargo test -p swc_ecma_transforms_react --features es3`
**Related issue (if exists):** Latest Branches
+4%
codex/reorganize-typescript-tests +4%
+4%
kdy1/fix-action-run-failure © 2026 CodSpeed Technology