0

I am using react-native-testing-library in order to test my app, and I found out that "regenerator-runtime/runtime" swallows critical errors in my app, so I am trying now to get rid of it. I also found out that react-native/jest/setup.js brings this lib directly. is there a way to disable regenerator in my tests so I could see all errors??

UPDATE: After some more investigation, It looks like regenerator is not the culprit, or at least it's not the only culprit. But my question remains the same- I still want to get rid of regenerator because it uglifies my stack trace and it's not necessary in the tests.

niryo
  • 1,275
  • 4
  • 15
  • 26
  • I doubt it swallows any errors that your code didn't tell it to swallow. Can you post a [mcve] please? – Bergi Dec 08 '21 at 13:22
  • sure, here: https://github.com/Niryo/minimal-swalloed-error-reproduce/tree/main . clone it and run jest, you will see that the test is green and there is no indication for the uncaught exception – niryo Dec 08 '21 at 14:12
  • ok, after further investigations, it seems that the issue could be related to a package called "promise" and not to regenerator. i'll investigate some more and update my question accordingly. thanks! – niryo Dec 08 '21 at 18:50
  • Really jest should just handle the rejected promise. – Bergi Dec 08 '21 at 20:25
  • what causes the issue is the setup file of react-native that override the global `promise` constructor with `global.Promise = jest.requireActual('promise');`. i'll create a separate question for how to get rid of it, but for now I want to leave this question open too because I want to get rid of the regenerator also. – niryo Dec 09 '21 at 10:00

0 Answers0