Skip to content

Commit

Permalink
test(transformer): script to amend Babel fixtures (#7122)
Browse files Browse the repository at this point in the history
Add a NodeJS script which amends Babel's fixtures in place to remove transform plugins which we don't support from `options.json` files. Where options are changed from the original, the script runs Babel transform with the new options to regenerate the fixture `output.js` files.

Currently limited to transforming the fixtures for `babel-plugin-transform-class-properties` transform, but we can also enable it for other plugins if we wish in future, to get additional test coverage.
  • Loading branch information
overlookmotel committed Nov 25, 2024
1 parent 3169bc6 commit 3b2a347
Show file tree
Hide file tree
Showing 5 changed files with 742 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ jobs:
save-cache: ${{ github.ref_name == 'main' }}
tools: just

- name: Update transformer fixtures
if: steps.filter.outputs.src == 'true'
run: node tasks/transform_conformance/update_fixtures.js

- name: Check Conformance
if: steps.filter.outputs.src == 'true'
run: |
Expand Down
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ submodules:
just clone-submodule tasks/coverage/babel https://github.com/babel/babel.git 54a8389fa31ce4fd18b0335b05832dc1ad3cc21f
just clone-submodule tasks/coverage/typescript https://github.com/microsoft/TypeScript.git d85767abfd83880cea17cea70f9913e9c4496dcc
just clone-submodule tasks/prettier_conformance/prettier https://github.com/prettier/prettier.git 52829385bcc4d785e58ae2602c0b098a643523c9
node tasks/transform_conformance/update_fixtures.js

# Install git pre-commit to format files
install-hook:
Expand Down
Loading

0 comments on commit 3b2a347

Please sign in to comment.