first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
const AccessibilityInfo = {
addEventListener: jest.fn(() => ({
remove: jest.fn(),
})) as JestMockFn<$FlowFixMe, {remove: JestMockFn<[], void>}>,
announceForAccessibility: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
announceForAccessibilityWithOptions: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
isAccessibilityServiceEnabled: jest.fn(() =>
Promise.resolve(false),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
isBoldTextEnabled: jest.fn(() => Promise.resolve(false)) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
isGrayscaleEnabled: jest.fn(() => Promise.resolve(false)) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
isInvertColorsEnabled: jest.fn(() => Promise.resolve(false)) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
isReduceMotionEnabled: jest.fn(() => Promise.resolve(false)) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
isHighTextContrastEnabled: jest.fn(() =>
Promise.resolve(false),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
isDarkerSystemColorsEnabled: jest.fn(() =>
Promise.resolve(false),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
prefersCrossFadeTransitions: jest.fn(() =>
Promise.resolve(false),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
isReduceTransparencyEnabled: jest.fn(() =>
Promise.resolve(false),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
isScreenReaderEnabled: jest.fn(() => Promise.resolve(false)) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
setAccessibilityFocus: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
sendAccessibilityEvent: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
getRecommendedTimeoutMillis: jest.fn(() =>
Promise.resolve(false),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
};
export default AccessibilityInfo;

View File

@@ -0,0 +1,23 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import typeof TActivityIndicator from '../../Libraries/Components/ActivityIndicator/ActivityIndicator';
import typeof * as TmockComponent from '../mockComponent';
const mockComponent =
jest.requireActual<TmockComponent>('../mockComponent').default;
const ActivityIndicator = mockComponent(
'../Libraries/Components/ActivityIndicator/ActivityIndicator',
null, // instanceMethods
true, // isESModule
) as TActivityIndicator;
export default ActivityIndicator;

19
node_modules/react-native/jest/mocks/AppState.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
const AppState = {
addEventListener: jest.fn(() => ({
remove: jest.fn(),
})) as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeEventListener: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
currentState: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
};
export default AppState;

16
node_modules/react-native/jest/mocks/Clipboard.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
const Clipboard = {
getString: jest.fn(async () => '') as JestMockFn<[], Promise<string>>,
setString: jest.fn() as JestMockFn<[string], void>,
};
export default Clipboard;

23
node_modules/react-native/jest/mocks/Image.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import typeof TImage from '../../Libraries/Image/Image';
import typeof * as TmockComponent from '../mockComponent';
const mockComponent =
jest.requireActual<TmockComponent>('../mockComponent').default;
const Image = mockComponent(
'../Libraries/Image/Image',
null, // instanceMethods
true, // isESModule
) as TImage;
export default Image;

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/

28
node_modules/react-native/jest/mocks/Linking.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
const Linking = {
openURL: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
canOpenURL: jest.fn(() => Promise.resolve(true)) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
openSettings: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
addEventListener: jest.fn(() => ({
remove: jest.fn(),
})) as JestMockFn<$FlowFixMe, $FlowFixMe>,
getInitialURL: jest.fn(() => Promise.resolve()) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
sendIntent: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
};
export default Linking;

33
node_modules/react-native/jest/mocks/Modal.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import type {ModalProps} from '../../Libraries/Modal/Modal';
import typeof * as TmockComponent from '../mockComponent';
const mockComponent =
jest.requireActual<TmockComponent>('../mockComponent').default;
type TModal = component(...ModalProps);
const BaseComponent = mockComponent(
'../Libraries/Modal/Modal',
null, // instanceMethods
true, // isESModule
) as TModal;
// $FlowFixMe[incompatible-use]
export default class Modal extends BaseComponent {
render(): React.Node {
if (this.props.visible === false) {
return null;
}
return <BaseComponent {...this.props}>{this.props.children}</BaseComponent>;
}
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import typeof * as TmockNativeComponent from '../mockNativeComponent';
const mockNativeComponent = jest.requireActual<TmockNativeComponent>(
'../mockNativeComponent',
).default;
export const get = jest.fn((name, viewConfigProvider) => {
return mockNativeComponent(name);
}) as JestMockFn<$FlowFixMe, $FlowFixMe>;
export const getWithFallback_DEPRECATED = jest.fn(
(name, viewConfigProvider) => {
return mockNativeComponent(name);
},
) as JestMockFn<$FlowFixMe, $FlowFixMe>;
export const setRuntimeConfigProvider = jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>;

239
node_modules/react-native/jest/mocks/NativeModules.js generated vendored Normal file
View File

@@ -0,0 +1,239 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
// TODO: Split this up into separate files.
const NativeModules = {
AlertManager: {
alertWithArgs: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
AsyncLocalStorage: {
multiGet: jest.fn((keys, callback) =>
process.nextTick(() => callback(null, [])),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
multiSet: jest.fn((entries, callback) =>
process.nextTick(() => callback(null)),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
multiRemove: jest.fn((keys, callback) =>
process.nextTick(() => callback(null)),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
multiMerge: jest.fn((entries, callback) =>
process.nextTick(() => callback(null)),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
clear: jest.fn(callback =>
process.nextTick(() => callback(null)),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
getAllKeys: jest.fn(callback =>
process.nextTick(() => callback(null, [])),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
DeviceInfo: {
getConstants(): $FlowFixMe {
return {
Dimensions: {
window: {
fontScale: 2,
height: 1334,
scale: 2,
width: 750,
},
screen: {
fontScale: 2,
height: 1334,
scale: 2,
width: 750,
},
},
};
},
},
DevSettings: {
addMenuItem: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
reload: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
ImageLoader: {
getSize: jest.fn(url => Promise.resolve([320, 240])) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
getSizeWithHeaders: jest.fn((url, headers) =>
Promise.resolve({height: 222, width: 333}),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
prefetchImage: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
prefetchImageWithMetadata: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
queryCache: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
ImageViewManager: {
getSize: jest.fn((uri, success) =>
process.nextTick(() => success(320, 240)),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
prefetchImage: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
KeyboardObserver: {
addListener: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeListeners: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
NativeAnimatedModule: {
createAnimatedNode: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
updateAnimatedNodeConfig: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
getValue: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
startListeningToAnimatedNodeValue: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
stopListeningToAnimatedNodeValue: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
connectAnimatedNodes: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
disconnectAnimatedNodes: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
startAnimatingNode: jest.fn((animationId, nodeTag, config, endCallback) => {
setTimeout(() => endCallback({finished: true}), 16);
}) as JestMockFn<$FlowFixMe, $FlowFixMe>,
stopAnimation: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setAnimatedNodeValue: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setAnimatedNodeOffset: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
flattenAnimatedNodeOffset: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
extractAnimatedNodeOffset: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
connectAnimatedNodeToView: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
disconnectAnimatedNodeFromView: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
restoreDefaultValues: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
dropAnimatedNode: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
addAnimatedEventToView: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeAnimatedEventFromView: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
addListener: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeListener: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeListeners: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
Networking: {
sendRequest: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
abortRequest: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
addListener: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeListeners: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
PlatformConstants: {
getConstants(): $FlowFixMe {
return {
reactNativeVersion: {
major: 1000,
minor: 0,
patch: 0,
prerelease: undefined,
},
};
},
},
PushNotificationManager: {
presentLocalNotification: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
scheduleLocalNotification: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
cancelAllLocalNotifications: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
removeAllDeliveredNotifications: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
getDeliveredNotifications: jest.fn(callback =>
process.nextTick(() => []),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeDeliveredNotifications: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
setApplicationIconBadgeNumber: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
getApplicationIconBadgeNumber: jest.fn(callback =>
process.nextTick(() => callback(0)),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
cancelLocalNotifications: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
getScheduledLocalNotifications: jest.fn(callback =>
process.nextTick(() => callback()),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
requestPermissions: jest.fn(() =>
Promise.resolve({alert: true, badge: true, sound: true}),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
abandonPermissions: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
checkPermissions: jest.fn(callback =>
process.nextTick(() => callback({alert: true, badge: true, sound: true})),
) as JestMockFn<$FlowFixMe, $FlowFixMe>,
getInitialNotification: jest.fn(() => Promise.resolve(null)) as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
addListener: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeListeners: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
SourceCode: {
getConstants(): $FlowFixMe {
return {
scriptURL: null,
};
},
},
StatusBarManager: {
setColor: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setStyle: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setHidden: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setNetworkActivityIndicatorVisible: jest.fn() as JestMockFn<
$FlowFixMe,
$FlowFixMe,
>,
setBackgroundColor: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setTranslucent: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
getConstants: (): $FlowFixMe => ({
HEIGHT: 42,
}),
},
Timing: {
createTimer: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
deleteTimer: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
UIManager: {},
BlobModule: {
getConstants: (): $FlowFixMe => ({
BLOB_URI_SCHEME: 'content',
BLOB_URI_HOST: null,
}),
addNetworkingHandler: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
enableBlobSupport: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
disableBlobSupport: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
createFromParts: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
sendBlob: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
release: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
WebSocketModule: {
connect: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
send: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
sendBinary: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
ping: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
close: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
addListener: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
removeListeners: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
I18nManager: {
allowRTL: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
forceRTL: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
swapLeftAndRightInRTL: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
getConstants: (): $FlowFixMe => ({
isRTL: false,
doLeftAndRightSwapInRTL: true,
}),
},
};
export default NativeModules;

31
node_modules/react-native/jest/mocks/RefreshControl.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import type {RefreshControlProps} from '../../Libraries/Components/RefreshControl/RefreshControl';
import type {HostComponent} from '../../src/private/types/HostComponent';
import requireNativeComponent from '../../Libraries/ReactNative/requireNativeComponent';
import * as React from 'react';
const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
'RCTRefreshControl',
);
export default class RefreshControlMock extends React.Component<RefreshControlProps> {
static latestRef: ?RefreshControlMock;
render(): React.Node {
return <RCTRefreshControl />;
}
componentDidMount() {
RefreshControlMock.latestRef = this;
}
}

45
node_modules/react-native/jest/mocks/RendererProxy.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
// In tests, we can use the default version without dependency injection.
import typeof * as TRendererImplementation from '../../Libraries/ReactNative/RendererImplementation';
const {
dispatchCommand,
findHostInstance_DEPRECATED,
findNodeHandle,
getNodeFromInternalInstanceHandle,
getPublicInstanceFromInternalInstanceHandle,
getPublicInstanceFromRootTag,
isChildPublicInstance,
isProfilingRenderer,
renderElement,
sendAccessibilityEvent,
unmountComponentAtNodeAndRemoveContainer,
unstable_batchedUpdates,
} = jest.requireActual<TRendererImplementation>(
'../../Libraries/ReactNative/RendererImplementation',
) as TRendererImplementation;
export {
dispatchCommand,
findHostInstance_DEPRECATED,
findNodeHandle,
getNodeFromInternalInstanceHandle,
getPublicInstanceFromInternalInstanceHandle,
getPublicInstanceFromRootTag,
isChildPublicInstance,
isProfilingRenderer,
renderElement,
sendAccessibilityEvent,
unmountComponentAtNodeAndRemoveContainer,
unstable_batchedUpdates,
};

58
node_modules/react-native/jest/mocks/ScrollView.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import typeof TScrollView from '../../Libraries/Components/ScrollView/ScrollView';
import type {ScrollViewNativeProps} from '../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
import typeof * as TmockComponent from '../mockComponent';
import typeof * as TMockNativeMethods from '../MockNativeMethods';
import View from '../../Libraries/Components/View/View';
import requireNativeComponent from '../../Libraries/ReactNative/requireNativeComponent';
import * as React from 'react';
const mockComponent =
jest.requireActual<TmockComponent>('../mockComponent').default;
const MockNativeMethods = jest.requireActual<TMockNativeMethods>(
'../MockNativeMethods',
).default;
const RCTScrollView =
requireNativeComponent<ScrollViewNativeProps>('RCTScrollView');
const BaseComponent = mockComponent(
'../Libraries/Components/ScrollView/ScrollView',
{
...MockNativeMethods,
getScrollResponder: jest.fn(),
getScrollableNode: jest.fn(),
getInnerViewNode: jest.fn(),
getInnerViewRef: jest.fn(),
getNativeScrollRef: jest.fn(),
scrollTo: jest.fn(),
scrollToEnd: jest.fn(),
flashScrollIndicators: jest.fn(),
scrollResponderZoomTo: jest.fn(),
scrollResponderScrollNativeHandleToKeyboard: jest.fn(),
}, // instanceMethods
true, // isESModule
) as TScrollView;
// $FlowFixMe[incompatible-type]
// $FlowFixMe[invalid-exported-annotation]
export default class ScrollViewMock extends BaseComponent {
render(): React.Node {
return (
<RCTScrollView {...this.props}>
{this.props.refreshControl}
<View>{this.props.children}</View>
</RCTScrollView>
);
}
}

27
node_modules/react-native/jest/mocks/Text.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import typeof TText from '../../Libraries/Text/Text';
import typeof * as TmockComponent from '../mockComponent';
import typeof * as TMockNativeMethods from '../MockNativeMethods';
const mockComponent =
jest.requireActual<TmockComponent>('../mockComponent').default;
const MockNativeMethods = jest.requireActual<TMockNativeMethods>(
'../MockNativeMethods',
).default;
const Text = mockComponent(
'../Libraries/Text/Text',
MockNativeMethods, // instanceMethods
true, // isESModule
) as TText;
export default Text;

32
node_modules/react-native/jest/mocks/TextInput.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import typeof TTextInput from '../../Libraries/Components/TextInput/TextInput';
import typeof * as TmockComponent from '../mockComponent';
import typeof * as TMockNativeMethods from '../MockNativeMethods';
const mockComponent =
jest.requireActual<TmockComponent>('../mockComponent').default;
const MockNativeMethods = jest.requireActual<TMockNativeMethods>(
'../MockNativeMethods',
).default;
const TextInput = mockComponent(
'../Libraries/Components/TextInput/TextInput',
{
...MockNativeMethods,
isFocused: jest.fn(),
clear: jest.fn(),
getNativeRef: jest.fn(),
}, // instanceMethods
true, // isESModule
) as TTextInput;
export default TextInput;

60
node_modules/react-native/jest/mocks/UIManager.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
const UIManager = {
AndroidViewPager: {
Commands: {
setPage: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setPageWithoutAnimation: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
},
},
blur: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
createView: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
customBubblingEventTypes: {},
customDirectEventTypes: {},
dispatchViewManagerCommand: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
focus: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
getViewManagerConfig: jest.fn(name => {
if (name === 'AndroidDrawerLayout') {
return {
Constants: {
DrawerPosition: {
Left: 10,
},
},
};
}
}) as JestMockFn<[string], $FlowFixMe>,
hasViewManagerConfig: jest.fn(name => {
return name === 'AndroidDrawerLayout';
}) as JestMockFn<[string], boolean>,
measure: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
manageChildren: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
setChildren: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
updateView: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
AndroidDrawerLayout: {
Constants: {
DrawerPosition: {
Left: 10,
},
},
},
AndroidTextInput: {
Commands: {},
},
ScrollView: {
Constants: {},
},
View: {
Constants: {},
},
};
export default UIManager;

16
node_modules/react-native/jest/mocks/Vibration.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
const Vibration = {
vibrate: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
cancel: jest.fn() as JestMockFn<$FlowFixMe, $FlowFixMe>,
};
export default Vibration;

27
node_modules/react-native/jest/mocks/View.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import typeof TView from '../../Libraries/Components/View/View';
import typeof * as TmockComponent from '../mockComponent';
import typeof * as TMockNativeMethods from '../MockNativeMethods';
const mockComponent =
jest.requireActual<TmockComponent>('../mockComponent').default;
const MockNativeMethods = jest.requireActual<TMockNativeMethods>(
'../MockNativeMethods',
).default;
const View = mockComponent(
'../Libraries/Components/View/View',
MockNativeMethods, // instanceMethods
true, // isESModule
) as TView;
export default View;

View File

@@ -0,0 +1,23 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import type {ViewProps} from '../../Libraries/Components/View/ViewPropTypes';
import * as React from 'react';
import {createElement} from 'react';
export default class View extends React.Component<ViewProps> {
render(): React.Node {
// $FlowFixMe[not-a-function]
return createElement('View', this.props, this.props.children);
}
}
View.displayName = 'View';

View File

@@ -0,0 +1,22 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import type {HostComponent} from '../../src/private/types/HostComponent';
import typeof * as TmockNativeComponent from '../mockNativeComponent';
const mockNativeComponent = jest.requireActual<TmockNativeComponent>(
'../mockNativeComponent',
).default;
export default function requireNativeComponent<T: {...}>(
uiViewClassName: string,
): HostComponent<T> {
return mockNativeComponent<T>(uiViewClassName);
}

18
node_modules/react-native/jest/mocks/useColorScheme.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import type {ColorSchemeName} from '../../Libraries/Utilities/NativeAppearance';
const useColorScheme = jest.fn(() => 'light') as JestMockFn<
[],
ColorSchemeName,
>;
export default useColorScheme;