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

Configure Babel to target your current version of Node with Jest #16259

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Jun 24, 2019

Description

It aims to fix the issue raised by @youknowriad in WordPress/wordpress-develop#69 (comment).

Fixes #16262.

@wordpress/babel-preset-default babel-jest and core-js dependencies are required to make sure we can use "import" and ESnext features while writing tests, I think this should be absorbed by @wordpress/scripts

This PR adds the missing babel-jest dependency and tries to update Babel config to remove the need for core-js but it seems like it's not working as intended.

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@gziolo gziolo added [Tool] Babel preset /packages/babel-preset-default [Tool] WP Scripts /packages/scripts labels Jun 24, 2019
@gziolo gziolo self-assigned this Jun 24, 2019
@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Jun 24, 2019
package.json Show resolved Hide resolved
@gziolo gziolo force-pushed the update/wordpress-scripts-babel-deps branch from 1330a79 to f2b9ca1 Compare July 26, 2019 17:20
@gziolo gziolo added [Type] Bug An existing feature does not function as intended and removed [Status] In Progress Tracking issues with work in progress labels Jul 26, 2019
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

The changes seem reasonable to me. We'd have to try an update the setup in Core later to test this properly.

@gziolo
Copy link
Member Author

gziolo commented Jul 29, 2019

The changes seem reasonable to me. We'd have to try an update the setup in Core later to test this properly.

Yes, I can take care of it as soon as this change is published to npm.

I also want to set up a very basic e2e test in https://github.com/WordPress/gutenberg-examples which would help to ensure this works as expected whenever we publish a new version to npm.

@gziolo gziolo merged commit dd4d205 into master Jul 29, 2019
@gziolo gziolo deleted the update/wordpress-scripts-babel-deps branch July 29, 2019 09:55
@gziolo gziolo added this to the Gutenberg 6.2 milestone Jul 29, 2019
@nerrad nerrad mentioned this pull request Sep 8, 2019
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] Babel preset /packages/babel-preset-default [Tool] WP Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error on import to test file when using @wordpress/scripts to run tests
3 participants