Files
react-native/packages/react-native/jest/MockNativeMethods.js
Tim Yung a4c2007068 RN: Flowify packages/react-native/jest (#51652)
Summary:
Adds `flow` (or `noflow`) to all files in this directory and ensures that Flow succeeds (by adding type annotations, using minor refactors, or suppressing errors due to intentionally dynamic logic).

This will help improve type safety when making changes both in these files as well as files that these depend on.

Changelog:
[Internal]

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

Test Plan:
Ran Flow and Jest tests successfully:

```
$ yarn flow
$ yarn test
```

Ran a Jest unit test internally to make sure they work with our internal environment setup:

```
$ cd ~/fbsource
$ js1 test /View-test.js
```

Reviewed By: javache

Differential Revision: D75488160

Pulled By: yungsters

fbshipit-source-id: 536cef9699acfa1edcd3dcf61c53ebcd92f560f9
2025-05-28 12:20:48 -07:00

28 lines
597 B
JavaScript

/**
* 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 MockNativeMethods = {
measure: jest.fn(),
measureInWindow: jest.fn(),
measureLayout: jest.fn(),
setNativeProps: jest.fn(),
focus: jest.fn(),
blur: jest.fn(),
} as {
measure: () => void,
measureInWindow: () => void,
measureLayout: () => void,
setNativeProps: () => void,
focus: () => void,
blur: () => void,
};
export default MockNativeMethods;