Move RefreshControlMock into Jest preset files (#51530)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51530

Alternative to https://github.com/facebook/react-native/pull/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
This commit is contained in:
Alex Hunt authored and Facebook GitHub Bot committed 2025-05-22 06:00:49 -07:00
1 parent 88ca4bb1b7
commit 6044e01460
2 files changed
+3 -5

No files matched your search

@@ -10,9 +10,9 @@
'use strict';
import type {HostComponent} from '../../../../src/private/types/HostComponent';
import type {HostComponent} from '../src/private/types/HostComponent';
import requireNativeComponent from '../../../ReactNative/requireNativeComponent';
import requireNativeComponent from '../Libraries/ReactNative/requireNativeComponent';
import * as React from 'react';
const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
+1 -3
View File
@@ -201,9 +201,7 @@ jest
}))
.mock('../Libraries/Components/RefreshControl/RefreshControl', () => ({
__esModule: true,
default: jest.requireActual(
'../Libraries/Components/RefreshControl/__mocks__/RefreshControlMock',
).default,
default: jest.requireActual('./RefreshControlMock').default,
}))
.mock('../Libraries/Components/ScrollView/ScrollView', () => {
const baseComponent = mockComponent(