Skip to content
Merged
Prev Previous commit
Next Next commit
Add Babel config for e2e-tests that babel-jest can find
  • Loading branch information
jsnajdr committed Mar 8, 2023
commit a1aae27cb398e201cdaaf8397babb85f946fde53
7 changes: 7 additions & 0 deletions packages/e2e-tests/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = ( api ) => {
api.cache( true );
Copy link
Member

Choose a reason for hiding this comment

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

Nice 👍

I can't think of a scenario where we'd actually want to cache the config per environment with api.cache.using( () => process.env.NODE_ENV ).

I wonder if enabling this config cache was motivated by something and whether this change affects the performance of the e2e tests.

Copy link
Member

Choose a reason for hiding this comment

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

It's for the test suites' source code. Isn't it always equal to test?

Copy link
Member Author

Choose a reason for hiding this comment

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

I admin I didn't think about proper caching at all when writing this 🙂 I just copied a statement that every other Babel config in the repo also uses.

Copy link
Member

Choose a reason for hiding this comment

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

It's for the test suites' source code. Isn't it always equal to test?

Yup, that's what I essentially was saying with:

I can't think of a scenario where we'd actually want to cache the config per environment with api.cache.using( () => process.env.NODE_ENV ).


return {
presets: [ '@wordpress/babel-preset-default' ],
};
};