New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not load root babel.config.js
in tests
#13087
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/44973/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c752cbd:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I'd think we'd only want to apply the config/options from options.json? Do we need to include babelrc: false as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, good to know that this solves a real problem! |
While working on the native ESM Babel build (wip implementation: https://github.com/nicolo-ribaudo/babel/tree/native-esm), I had to add some
configFile: false
to our tests (you can see them forbabel-core
at nicolo-ribaudo@5d15dc7) because they were accidentally loading the top-levelbabel.config.js
file.This didn't cause problems so far because our
babel.config.js
has anignore
entry forpackages/*/test/fixtures
, but it caused problems for the ESM tests because even if a file is ignored all the plugins/presets are still resolved andrequire
'd.Also, tests should be isolated so it's better to make sure that they don't accidentally load an unrelated config anyway.
cc @jridgewell If I recall correctly, AMP uses our test runner plugins. I would consider this PR a bugfix, but would it cause problems to AMP?