-
Notifications
You must be signed in to change notification settings - Fork 27
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
Conversation
🦋 Changeset detectedLatest commit: 0bb72fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/commercetools/merchant-center-application-kit/E91SbEb9FN3PNaa5JJrE5d4fqAFg |
@@ -5,6 +5,15 @@ const rootPath = process.cwd(); | |||
const resolveRelativePath = (relativePath) => | |||
path.resolve(__dirname, relativePath); | |||
|
|||
const defaultTransformFile = resolveRelativePath('./transform-file.js'); |
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.
Unrelated but inline requires are odd to me.
// `plugin-transform-runtime`. | ||
disableCoreJs: false, | ||
}, | ||
rtlConfig: {}, |
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.
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: { |
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.
To clearly scope it maybe.
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.
Nice!
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
).