-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExceptionsManager.handleException is not a function #29849
Comments
|
We're seeing the same issue repeatedly, trying to test Apollo mutations with react-native-testing-library. (This issue seems to totally swallow exception messages, so it is very painful when trying to debug unit tests!)
Environment info:
For now we can work around it just by moving this line to the top of
...And adding this mock to jest/setup.js in RN:
|
Sure, I'll submit what I have. |
Is there an update on this issue? This is blocking my upgrade. It occurs when we are running our test suite. |
Submitted PR: #30027 |
what worked for me (@lukewlms's solution works too but requires forking rn) was using |
Appreciate submitting the PR! |
Commented on the PR - I'd like to take a look at this, could someone set up a minimal reproduction for me? |
For me, adding beforeEach(() => {
jest.resetModules();
jest.resetAllMocks();
jest.useFakeTimers(); // <-- Add this
}); |
Dropping a note here on what worked for us when we encountered this issue. We did a mock of
|
great @lingumi-remy it works! |
i have sama the problem TypeError: ExceptionsManager.handleException is not a function maybe you forget add sync on test, i am bad for test example wrong test
});` and example true, like this :
});` this fix my issues |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
We recently upgraded to React Native 0.63, Jest 26, and React Native Testing Library 7. When running jest with
--runInBand
we have noticed the following error randomly in our CI:It appears that NativeExceptionsManager is mocked but handleException is not: https://github.com/facebook/react-native/blob/master/jest/setup.js#L42-L47
The text was updated successfully, but these errors were encountered: