-
Notifications
You must be signed in to change notification settings - Fork 24k
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
Make jest react-native preset to use typescript files #22217
Conversation
Generated by 🚫 dangerJS |
jest/hasteImpl.js
Outdated
// strip .js/.js.flow suffix | ||
[/^(.*)\.js(\.flow)?$/, '$1'], | ||
// strip .js/.ts/.tsx/.js.flow suffix | ||
[/^(.*)\.(js|ts|tsx)(\.flow)?$/, '$1'], |
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.
this regex will match ts.flow and tsx.flow
cc @rafeca in case there are additional files we need to be aware of. |
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.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Metro and react-native now have first-class support to Typescript with Babel 7, but react-native Jest preset needs specific settings to work with .ts and .tsx files.
This PR updates react-native Jest preset to use Typescript out of the box.
Test Plan:
There is a test to the hasteImpl file.
Changelog:
[GENERAL] [CHANGE] - Add Typescript to Jest react-native preset.