react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Add missing `remove` method to `addEventListener` Jest mocks

Open levibuzolic opened this issue 1 year ago • 0 comments

Summary:

While writing some Jest tests, I noticed some instances of the following error:

Cannot read properties of undefined (reading 'remove')

Looks like there were two cases where the {remove: () => {}} return result was missing in the provided Jest mocks:

  • AccessibilityInfo.addEventListener
  • Linking.addEventListener

Changelog:

[GENERAL] [FIXED] - Added missing remove methods for Linking.addEventListener and AccessibilityInfo.addEventListener Jest mocks

Test Plan

N/A

levibuzolic avatar Apr 26 '24 05:04 levibuzolic