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

Make jest react-native preset to use typescript files #22217

Closed
wants to merge 5 commits into from

Conversation

dalcib
Copy link
Contributor

@dalcib dalcib commented Nov 8, 2018

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:

  • Check yarn run lint
  • Check yarn run prettier
  • Check yarn run test
    There is a test to the hasteImpl file.

Changelog:

[GENERAL] [CHANGE] - Add Typescript to Jest react-native preset.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. ✅pr adds tests labels Nov 8, 2018
@pull-bot
Copy link

pull-bot commented Nov 8, 2018

Warnings
⚠️

📋 Release Notes - This PR appears to be missing Release Notes.

Generated by 🚫 dangerJS

// strip .js/.js.flow suffix
[/^(.*)\.js(\.flow)?$/, '$1'],
// strip .js/.ts/.tsx/.js.flow suffix
[/^(.*)\.(js|ts|tsx)(\.flow)?$/, '$1'],
Copy link
Contributor

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

@TheSavior
Copy link
Member

cc @rafeca in case there are additional files we need to be aware of.

jest/hasteImpl.js Outdated Show resolved Hide resolved
@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Dec 10, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@react-native-bot
Copy link
Collaborator

@dalcib merged commit af3570c into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Dec 10, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Dec 10, 2018
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants