You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Hi @McKayMower, you can turn off imagery by providing the option baseLayer: false to the viewer.
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: