79529a1c77
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 |
||
---|---|---|
.. | ||
MockNativeMethods.js | ||
assetFileTransformer.js | ||
mockComponent.js | ||
mockModal.js | ||
mockNativeComponent.js | ||
mockScrollView.js | ||
preprocessor.js | ||
preprocessor_DO_NOT_USE.js | ||
renderer.js | ||
setup.js |