Skip to content

Commit 6044e01

Browse files
huntiefacebook-github-bot
authored andcommitted
Move RefreshControlMock into Jest preset files (#51530)
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
1 parent 88ca4bb commit 6044e01

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
'use strict';
1212

13-
import type {HostComponent} from '../../../../src/private/types/HostComponent';
13+
import type {HostComponent} from '../src/private/types/HostComponent';
1414

15-
import requireNativeComponent from '../../../ReactNative/requireNativeComponent';
15+
import requireNativeComponent from '../Libraries/ReactNative/requireNativeComponent';
1616
import * as React from 'react';
1717

1818
const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(

packages/react-native/jest/setup.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ jest
201201
}))
202202
.mock('../Libraries/Components/RefreshControl/RefreshControl', () => ({
203203
__esModule: true,
204-
default: jest.requireActual(
205-
'../Libraries/Components/RefreshControl/__mocks__/RefreshControlMock',
206-
).default,
204+
default: jest.requireActual('./RefreshControlMock').default,
207205
}))
208206
.mock('../Libraries/Components/ScrollView/ScrollView', () => {
209207
const baseComponent = mockComponent(

0 commit comments

Comments
 (0)