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

Apparently linked problem using Jest

Open ManuF17 opened this issue 1 year ago • 2 comments

Current behavior

The package is working fine, but when i trying to run couple of tests they are failing because of the following error:

Screenshot 2023-11-20 at 8 28 51 a m

Expected behavior

During our tests won't see any error related to this package.

Platform

  • [X] Android
  • [X] iOS

React Native Version

0.72.6

React Native Compressor Version

1.8.12

Reproducible Steps And Demo

ManuF17 avatar Nov 20 '23 14:11 ManuF17

👋 @ManuF17 Thanks for opening your issue here! If you find this package useful hit the star🌟!

github-actions[bot] avatar Nov 20 '23 14:11 github-actions[bot]

You should mock it:

jest.mock('react-native-compressor', () => ({
    Image: {
        compress: uri => Promise.resolve(uri)
    }
}));

murat-mehmet avatar Nov 21 '23 12:11 murat-mehmet