Skip to content

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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Aarshpatel12
Copy link

@Aarshpatel12 Aarshpatel12 commented Jun 21, 2025

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
Copy link
Collaborator

react-native-bot commented Jun 21, 2025

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
Copy link
Member

@javache javache left a comment

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
Copy link
Member

javache commented Jun 23, 2025

Copy link
Contributor

@cipolleschi cipolleschi left a comment

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.

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.
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