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
RequetErrorEvent during Jest testing. #11965
Comments
Hi @McKayMower, you can turn off imagery by providing the option In many CesiumJS tests, we also stub out web requests to help with reliability. The exact mechanic of how to do that depends on your particular app though. CesiumJS is a big project, so we use GitHub for feature requests and bug tracking exclusively. In the future, please take any questions to the Cesium Forum where there are members of the community and developers from the team who can help. Thanks! |
What happened?
I am writing tests in Jest.
I have a React component for the Cesium viewer:
Now, in my Jest tests, I am failing tests due to request errors. See the image below.
Something to note: I am testing in a headless environment so I use the getWebGLStub helper function found in the cesium repository.
Since I am testing in a headless environment window.location (which is used in the requests) will be undefined. When I go to render my component, it appears the requests for imagery layers are sent off. How can I disable these requests? Since these requests throw the error seen below, the tests automatically fail.
Reproduction steps
...
Sandcastle example
No response
Environment
Browser: N/A
CesiumJS Version: 1.115
Operating System: Ubuntu 22.04.3 LTS
The text was updated successfully, but these errors were encountered: