react-native-macos/jest
Adrian Hartanto 2aba3522ab fix: adjust clipboard mock (#34672)
Summary:
Currently, Clipboard's methods (setString, getString) can't be asserted when writing tests as the mock targeted `Libraries/BatchedBridge/NativeModules` instead of `Libraries/Components/Clipboard/Clipboard` that's used on react-native [entry point](https://github.com/facebook/react-native/blob/main/index.js#L270) so it won't be considered as `mock function`.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - Update `Clipboard` mock path

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

Test Plan:
```js
// App-test.js

import { Clipboard } from 'react-native';
import React from 'react';

it('renders correctly', () => {
  Clipboard.setString('string');
  expect(Clipboard.setString).toBeCalled();
});
```

### before

<img width="473" alt="Screen Shot 2022-09-13 at 16 24 30" src="https://user-images.githubusercontent.com/5382429/189864957-6b926478-6781-4291-a1eb-4493779de1a2.png" />

### after

<img width="598" alt="Screen Shot 2022-09-13 at 16 26 34" src="https://user-images.githubusercontent.com/5382429/189865131-e7c39f97-1cc1-4eb9-b4c0-d9ddf7a05c9c.png" />

Reviewed By: yungsters

Differential Revision: D39575916

Pulled By: cortinico

fbshipit-source-id: 34a3f93986a18d349ac033bb13a10ed77689935c
2022-09-16 08:54:05 -07:00
..
private Remove babel plugins from jest preprocessor which are part of preset 2022-05-12 03:48:24 -07:00
MockNativeMethods.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
assetFileTransformer.js fix(jest): make assetFileTransformer return an object (#33756) 2022-06-17 10:27:47 -07:00
mockComponent.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
mockModal.js fix(jest/setup): fix circular dependencies in mockModal (#32964) 2022-01-26 23:54:55 -08:00
mockNativeComponent.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
mockScrollView.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
renderer.js @emails -> @oncall (remaining ones) 2022-09-15 15:54:10 -07:00
setup.js fix: adjust clipboard mock (#34672) 2022-09-16 08:54:05 -07:00