Skip to content

fix(jest): restore RefreshControl mock to fix tests in RN 0.80 (Fixes: #52152)#52180

Open
Aarshpatel12 wants to merge 1 commit into
react:mainfrom
Aarshpatel12:fix/jest-refreshcontrol-mock
Open

fix(jest): restore RefreshControl mock to fix tests in RN 0.80 (Fixes: #52152)#52180
Aarshpatel12 wants to merge 1 commit into
react:mainfrom
Aarshpatel12:fix/jest-refreshcontrol-mock

Conversation

@Aarshpatel12

@Aarshpatel12 Aarshpatel12 commented Jun 21, 2025

Copy link
Copy Markdown

This PR fixes a regression introduced in React Native 0.80.0 where Jest tests fail due to a missing RefreshControlMock file.

The mock was removed in #50784 when .npmignore files were replaced, causing a missing reference during Jest setup. This impacts not just core tests, but also third-party libraries such as react-native-gesture-handler and react-native-drawer-layout that depend on this mock during testing.

Changelog

[Internal] Fixed missing Jest mock for RefreshControl causing test failures in React Native 0.80.0.

Test Plan

  • Restored RefreshControlMock.js in Libraries/Components/RefreshControl/__mocks__
  • Ran yarn test locally on both macOS and Windows — all test suites and snapshots passed
  • Confirmed the file is included in npm pack and not ignored

Fixes: #52152

@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 Jun 21, 2025
@react-native-bot

react-native-bot commented Jun 21, 2025

Copy link
Copy Markdown
Collaborator
Fails
🚫

📋 Missing Changelog - Please add a Changelog to your PR description. See Changelog format

Generated by 🚫 dangerJS against 9418ccd

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 21, 2025

@javache javache left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There seem to be more changes here than just the RefreshControlMock. Please revert those.

@javache

javache commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

@cipolleschi cipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can't accept this fix. The snapshots have been updated in a windows machine and all of them now use \ as path separators insteado of /. This will break tests internally as in CI we run them using linux based machines.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

@react-native-bot react-native-bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Dec 21, 2025
@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 19, 2026
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Stale There has been a lack of activity on this issue and it may be closed soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React Native 0.80.0's jest setup is broken due to missing mock files

5 participants