Skip to content
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

Use full import specifier path in tests #13938

Merged
merged 2 commits into from Nov 24, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Nov 7, 2021

Q                       A
License MIT

Since the main blocker for migrating to ESM (#13414) is Jest support (Jest reimplements the whole ESM linker, and it has some bugs + Node.js doesn't have a stable API to do it), I'm experimenting with a lightweight approach where I only use part of Jest and run the tests in a native Node.js environment.

I'm starting by only running the tests as ESM (rather than converting them to CJS on-the-fly), but in order to run them natively import statements must have the full path.

@babel-bot
Copy link
Collaborator

babel-bot commented Nov 7, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/49741/

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 7, 2021

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 9a07e1a:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@nicolo-ribaudo
Copy link
Member Author

I missed some of them

@nicolo-ribaudo nicolo-ribaudo marked this pull request as draft November 7, 2021 18:27
Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off-topic - Moved to #13966

If we bundle every package in Babel 8, how should we specify the path of imported modules, especially for those unit tests?

@nicolo-ribaudo

This comment has been minimized.

@JLHwung

This comment has been minimized.

@nicolo-ribaudo

This comment has been minimized.

@nicolo-ribaudo

This comment has been minimized.

@nicolo-ribaudo
Copy link
Member Author

I'm moving this discussion to #13966.

@nicolo-ribaudo nicolo-ribaudo merged commit 75996cb into babel:main Nov 24, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the test-explicit-js-ext branch November 24, 2021 10:43
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants