A framework for building native applications using React
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
H
hduprat committed
79529a1c77e7e1b174fdbe8103a2199c9ac924ff
Parent: a649675
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 5/3/2022, 6:29:48 PM