-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
“Cannot read property _location of null” when testing with Jest and react-testing-library #12107
Comments
There's nothing about a Nonetheless, could you please share the full error message with the full stack? Maybe I can point you in the right direction. |
Hi @phryneas I appreciate your help! Here is the full stack trace:
I hope that's readable! |
That seems to be coming somewhere out of |
As I don't think we can do anything here, I'm going to close the issue here - I hope you find a solution for this! |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am encountering this issue intermittently but regularly when testing my NextJS React application using Jest and react-testing-library. Tests are randomly failing with the error:
"Cannot read property _location of null"
This happens, I believe, because the Jest test process exits too quickly relative to what Apollo is doing, but I confess my understanding of this is a bit lacking.
I would appreciate any guidance on the issue and how I can resolve it! I have provided an example of how I am using Apollo as part of a custom render function in my tests.
Thanks in advance
Example:
and then run a test:
The text was updated successfully, but these errors were encountered: