react-native-macos/jest
hduprat 79529a1c77 Add Vibration module mock (#30643)
Summary:
I wrote a test for a vibration feature in a react native app by importing the `Vibration` module and using `jest.spyOn(Vibration, 'vibrate')`.

I had the following error:
```
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'Vibration' could not be found. Verify that a module by this name is registered in the native binary.
```

That lead me to look for (and not find) a mock for the `Vibration` module in the code.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Add Jest mock for Vibration module

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

Test Plan:
I would be glad to provide a test plan for this, but as it is part of testing I don't really know how to do so.
Any suggestion or help is welcome!

Reviewed By: yungsters

Differential Revision: D36097003

Pulled By: cortinico

fbshipit-source-id: 58683120da34f40e142a44c4bef8a5fced04bac2
2022-05-03 11:29:48 -07:00
..
MockNativeMethods.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
assetFileTransformer.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08: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
preprocessor.js Deprecate jest/preprocessor.js 2022-03-14 07:40:05 -07:00
preprocessor_DO_NOT_USE.js fix(preprocessor): return object, not just code (#33576) 2022-04-07 08:23:50 -07:00
renderer.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
setup.js Add Vibration module mock (#30643) 2022-05-03 11:29:48 -07:00