You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## [5.7.1](v5.7.0...v5.7.1) (2020-04-14)
### Bug Fixes
* Fix the provided Jest mock so it works with the instructions in the README ([a24ebb1](a24ebb1)), closes [#345](#345) [#327](#327)
Environment
Platforms
neither, issue appears in jest tests
Versions
Description
The mock exported by the package to be used in the
jest.setup.js
file provides a different API than the package itself.The mock that is currently exported is
whereas the TypeScript definition file has the following default export:
Running tests on a component that uses
addEventListener
gives the following error:since the mock only provides an
addListener
function.If I mock the module out manually with the functions I'm using, it works as expected
The current documentation also implies that
NativeModules
needs to be imported in the jest setup file, although it isn't used.Reproducible Demo
Create any component that calls
addEventListener
and write a simple test for it:component:
test:
The text was updated successfully, but these errors were encountered: