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

use requireActual and requireMock from jest instead of require #21849

Closed
wants to merge 1 commit into from

Conversation

thymikee
Copy link
Contributor

@thymikee thymikee commented Oct 18, 2018

A while back Jest introduced jest.requireActual and jest.requireMock which are aliases to require.requireActual and require.requireMock. We believe that users should use official Jest API and are planning to deprecate the latter.

Test Plan:

Only Jest-related changes, CI should be green.

Release Notes:

[GENERAL] [ENHANCEMENT] [tests] - Use requireActual and requireMock from jest object instead of require.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 18, 2018
@pull-bot
Copy link

Warnings
⚠️

📋 Test Plan - This PR appears to be missing a Test Plan.

Generated by 🚫 dangerJS

@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 Oct 18, 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.

TheSavior is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@elicwhite
Copy link
Member

Thanks for this. If you are curious, it looks like the majority of Facebook's callsites to require.requireActual is in the source to react-relay. A PR there would further help Facebook migrate off.

@thymikee
Copy link
Contributor Author

Sure, gonna update it there too, thanks!

@thymikee
Copy link
Contributor Author

Relay: facebook/relay#2550

@react-native-bot
Copy link
Collaborator

@thymikee merged commit 5e997f9 into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 18, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 18, 2018
@thymikee thymikee deleted the tests/jest-vs-require branch October 19, 2018 07:48
grabbou pushed a commit to react-native-community/cli that referenced this pull request Nov 6, 2018
Summary:
A while back Jest introduced `jest.requireActual` and `jest.requireMock` which are aliases to `require.requireActual` and `require.requireMock`. We believe that users should use official Jest API and are planning to deprecate the latter.
Pull Request resolved: facebook/react-native#21849

Differential Revision: D10448849

Pulled By: TheSavior

fbshipit-source-id: 34fffde97f48c26098c74ee222a56d99071703a6
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
…ook#21849)

Summary:
A while back Jest introduced `jest.requireActual` and `jest.requireMock` which are aliases to `require.requireActual` and `require.requireMock`. We believe that users should use official Jest API and are planning to deprecate the latter.
Pull Request resolved: facebook#21849

Differential Revision: D10448849

Pulled By: TheSavior

fbshipit-source-id: 34fffde97f48c26098c74ee222a56d99071703a6
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. p: Callstack Partner: Callstack Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants