Skip to content

Move RefreshControlMock into Jest preset files #51530

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

Closed
wants to merge 1 commit into from

Conversation

huntie
Copy link
Member

@huntie huntie commented May 22, 2025

Summary:
Alternative to #50784.

__mocks__ (and other underscored dirs) are correctly excluded from our npm package via package.json#files. But in this instance, this is a source file for the jest/ directory (Jest preset within react-native), and should be included — fix by relocating.

Changelog:
[General][Fixed] - Fix missing RefreshControlMock source in Jest preset

Reviewed By: rshest

Differential Revision: D75215731

@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. p: Facebook Partner: Facebook Partner labels May 22, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75215731

Summary:
Pull Request resolved: facebook#51530

Alternative to facebook#50784.

`__mocks__` (and other underscored dirs) are correctly excluded from our npm package via `package.json#files`. But in this instance, this is a source file for the `jest/` directory (Jest preset within `react-native`), and should be included — fix by relocating.

Changelog:
[General][Fixed] - Fix missing RefreshControlMock source in Jest preset

Reviewed By: rshest

Differential Revision: D75215731
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D75215731

@huntie huntie force-pushed the export-D75215731 branch from 19207c8 to b3de909 Compare May 22, 2025 11:43
Copy link
Contributor

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

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

LGTM

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 22, 2025
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6044e01.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @huntie in 6044e01

When will my fix make it into a release? | How to file a pick request?

@jerone
Copy link

jerone commented May 26, 2025

@huntie Sorry to hijack this PR.
Is this PR related to Jest throwing "RangeError: Invalid string length" when creating snapshots?

If that's the case, we are seeing this issue on more components: ScrollView & FlatLast.

@mdjastrzebski
Copy link
Contributor

@jerone No. Reported error occurs during analysing imports rather than execution of tests.

@huntie huntie deleted the export-D75215731 branch May 26, 2025 12:34
mdjastrzebski pushed a commit to mdjastrzebski/react-native that referenced this pull request Jun 11, 2025
Summary:
Pull Request resolved: facebook#51530

Alternative to facebook#50784.

`__mocks__` (and other underscored dirs) are correctly excluded from our npm package via `package.json#files`. But in this instance, this is a source file for the `jest/` directory (Jest preset within `react-native`), and should be included — fix by relocating.

Changelog:
[General][Fixed] - Fix missing RefreshControlMock source in Jest preset

Reviewed By: rshest

Differential Revision: D75215731

fbshipit-source-id: 1240344c4236288f31b16513f4df16766ad1e571

# Conflicts:
#	packages/react-native/jest/setup.js
fabriziocucci pushed a commit that referenced this pull request Jun 23, 2025
Summary:
Pull Request resolved: #51530

Alternative to #50784.

`__mocks__` (and other underscored dirs) are correctly excluded from our npm package via `package.json#files`. But in this instance, this is a source file for the `jest/` directory (Jest preset within `react-native`), and should be included — fix by relocating.

Changelog:
[General][Fixed] - Fix missing RefreshControlMock source in Jest preset

Reviewed By: rshest

Differential Revision: D75215731

fbshipit-source-id: 1240344c4236288f31b16513f4df16766ad1e571
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @huntie in aeab69a

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants