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

feat(jest-preset-mc-app): add babelConfig to jest config #2262

Merged
merged 2 commits into from
Jun 11, 2021

Conversation

tdeekens
Copy link
Contributor

Summary

Adds support for a babelConfig in the cosmiconfig for jest (so the `jest-preset-mc-app.config.js in a project's root).

Description

The babel config (babel-preset-mc-app) has various configuration options. At times it can make sense to pass down values to the config (e.g. to disableCoreJs).

@changeset-bot
Copy link

changeset-bot bot commented Jun 11, 2021

🦋 Changeset detected

Latest commit: 0bb72fa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@commercetools-frontend/jest-preset-mc-app Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jun 11, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/commercetools/merchant-center-application-kit/E91SbEb9FN3PNaa5JJrE5d4fqAFg
✅ Preview: https://merchant-center-application-kit-git-feat-a-f13c68-commercetools.vercel.app

@@ -5,6 +5,15 @@ const rootPath = process.cwd();
const resolveRelativePath = (relativePath) =>
path.resolve(__dirname, relativePath);

const defaultTransformFile = resolveRelativePath('./transform-file.js');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated but inline requires are odd to me.

// `plugin-transform-runtime`.
disableCoreJs: false,
},
rtlConfig: {},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used by setup-test-framework just to have all defaults listed here.

@@ -19,6 +19,13 @@ const defaultConfig = {
/.*@commercetools-frontend\/permissions.*/,
/.*Warning: React.createFactory() is deprecated.*/,
],
babelConfig: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To clearly scope it maybe.

Copy link
Contributor

@pa3 pa3 left a comment

Choose a reason for hiding this comment

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

Nice!

@vercel vercel bot temporarily deployed to Preview June 11, 2021 07:54 Inactive
@tdeekens tdeekens marked this pull request as ready for review June 11, 2021 07:55
@tdeekens tdeekens merged commit 4d9bce0 into main Jun 11, 2021
@tdeekens tdeekens deleted the feat/add-babel-config branch June 11, 2021 08:11
@ghost ghost mentioned this pull request Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants