1

I'm doing render testing of a login screen that returns an error when an image is on the screen and I don't know what to solve

test code

it('render screen Login ', () => {render(<Login />);});

return error

125 |             <Image
> 126 |               source={require('../../img/Login/facebook.png')}
      |                       ^
  127 |               style={styles.icon}
  128 |             />

enter image description here

Error text

Invalid return value: process() or/and processAsync() method of code transformer found at "F:/app/green1/node_modules/react-native/jest/assetFileTransformer.js"
should return an object or a Promise resolving to an object. The object must have code property with a string of processed code. This error may be caused by a breaking change in Jest 28: https://jestjs.io/docs/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation

Iva
  • 2,447
  • 1
  • 18
  • 28
ANAS SH
  • 11
  • 3
  • Does this answer your question? [Importing images breaks jest test](https://stackoverflow.com/questions/46898638/importing-images-breaks-jest-test) – Thanhal P A Jul 25 '22 at 12:27
  • 1
    I solved the problem by adding the following [see this solution](https://stackoverflow.com/a/67054924/17866871) – ANAS SH Jul 26 '22 at 11:44

0 Answers0