Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Bw/alpha bump #430
Bw/alpha bump #430
Changes from all commits
deacfed
3b8f66a
a0f24df
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
[tj]sx
also matches '.jsx' (which the above babel-jest transform covers). Is that intentional?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.
hrm... fwiw, this came from @adamstankiewicz, and I believe from an online source before that, so not sure.
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.
does seem like it would probably be equivalent with just the
t
in there, though also would be safe this way in case someone removes the earlier transform later?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.
I haven't been able to find a documentation on how jest handles transformation where a file is matched by multiple transformers (does it use the first matched transformer, or all of them?). My main concerns here are:
A) Even if this setup is working now, it may be a quirk of implementation that may change later.
B) Client repos may add yet more overlapping transformers to this config, that could interact in unpredictable ways.
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.
The
^.+\\.[tj]sx?$
regex is the same key as used intsjPreset.transform
; only the key's value is different in this change. It's preferable to keep both[tj]
such that files that contain TypeScript without the.tsx?
extension still get transformed byts-jest
. Thets-jest
source code does appear to handlejsx?
extensions.It uses all of the configured transformers matching the specified file extension(s), processed in the order that they are listed.
I'm not too concerned about this. Some client repos already customize the
jest.config.js
. If they do so by extending the defaultjest.config.js
provided by frontend-build versus overriding its default behavior by providing the 2nd arg tocreateConfig
, their changes are deep merged with the default config (additive totransforms
). However, if they use custom manipulations (i.e., "Method 2" in README), they could run the risk of removing the default transforms by completely replacingconfig.transforms
. That said, I feel this is a similar risk to pretty much all the other config properties, IMHO.