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

Added support for babel.config.js #6911

Merged
merged 2 commits into from Aug 29, 2018

Conversation

ross-weir
Copy link
Contributor

@ross-weir ross-weir commented Aug 29, 2018

Summary

Fixes #6908

With the arrival of Babel 7.0.0 comes support for .js configuration files from Babel.

See here for details.

We are introducing babel.config.js. It isn't a requirement or even a replacement for .babelrc, but having this may be useful in certain cases.

*.js configuration files are fairly common in the JavaScript ecosystem. ESLint and Webpack both allow for .eslintrc.js and webpack.config.js configuration files, respectively.

This PR adds support for the new config file added by the Babel team.

Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Mind adding a changelog entry? :)

@ross-weir
Copy link
Contributor Author

Added changelog entry. Thanks! :)

@codecov-io
Copy link

codecov-io commented Aug 29, 2018

Codecov Report

Merging #6911 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6911      +/-   ##
==========================================
- Coverage   66.98%   66.98%   -0.01%     
==========================================
  Files         250      250              
  Lines       10360    10365       +5     
  Branches        3        3              
==========================================
+ Hits         6940     6943       +3     
- Misses       3419     3421       +2     
  Partials        1        1
Impacted Files Coverage Δ
packages/babel-jest/src/index.js 88.7% <ø> (-2.52%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b1e8c3...9586cc5. Read the comment docs.

@thymikee thymikee requested a review from SimenB August 29, 2018 11:38
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Note that this just adds support in our cache busting - we already supported the config file for actual configuration of babel (as we just ask babel to do the transpilation for us)

@SimenB SimenB merged commit 8e72341 into jestjs:master Aug 29, 2018
@miguel-orange
Copy link

@SimenB - Thanks for the comment, all I needed to do when migrating from .babelrc to babel.config.js is --clearCache, and jest picked up the js.

@capsule5
Copy link

Is it possible to access babel.config.js from a custom path?

@SimenB
Copy link
Member

SimenB commented Jan 29, 2019

Yeah, using a custom transformer: https://jestjs.io/docs/en/tutorial-react#custom-transformers

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Babel-jest support for babel.config.js configuration file
7 participants