Add file URL support for test runners#18002
Merged
Merged
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/61564 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds file URL support to Babel’s fixture/test runners and updates tests to avoid __dirname-based fixture resolution where possible.
Changes:
- Allows fixture helpers and transform/process test runners to accept
URLinstances. - Updates parser, generator, CLI/node helper, and ESLint parser tests to pass fixture locations as file URLs.
- Moves the SystemJS exec-specific test into its own Jest test file using URL-based filename handling.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/babel-helper-fixtures/src/index.ts |
Accepts URL fixture roots by converting them to filesystem paths. |
packages/babel-helper-transform-fixture-test-runner/src/index.ts |
Accepts URL filenames/fixture dirs for transform and process runners. |
packages/babel-helper-plugin-test-runner/src/index.ts |
Passes fixture roots as URLs and derives package names via fileURLToPath. |
packages/babel-parser/test/index.js |
Uses a file URL for parser fixtures. |
packages/babel-parser/test/expressions.js |
Uses a file URL for expression fixtures. |
packages/babel-types/test/fields.js |
Uses a file URL for parser fixture discovery. |
packages/babel-generator/test/index.js |
Uses a file URL for generator fixtures. |
packages/babel-cli/test/helpers/runner.js |
Passes CLI fixtures as a file URL. |
packages/babel-node/test/helpers/runner.js |
Passes node fixtures as a file URL. |
packages/babel-build-external-helpers/test/helpers/runner.js |
Passes external-helper fixtures as a file URL. |
packages/babel-plugin-transform-modules-systemjs/test/index.js |
Leaves the generic fixture runner entrypoint only. |
packages/babel-plugin-transform-modules-systemjs/test/systemjs-exec.test.js |
Adds the extracted SystemJS exec regression test using URL filenames. |
eslint/babel-eslint-parser/test/typescript-estree.test.js |
Uses URL-based parser fixture roots and URL href comparisons for known failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
commit: |
liuxingbaoyu
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1, Fixes #2In this PR we add file URL support for test runners and phase out usage of
__dirnamein the test files.