chore(tests): add GLTFLoader integration test
This PR is made in attempt to remove the following blocker. #3085 There is an existing PR #3086 and this is to solve the blocker on that pr.
This commit adds an integration test for useLoader with GLTFLoader.
The test verifies that the loader can correctly parse a binary GLB file. To achieve this in a Node.js test environment, the following changes were made:
-
node-fetchis added as a dev dependency to providefetch,Request, andResponseobjects. - These are polyfilled globally in the Jest setup file for all tests to use.
- The test mocks the
fetchcall to return a minimal, valid GLB file as anArrayBuffer.
This approach was chosen after discovering that the native test environment does not support the features required for a full native integration test.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit d6f25b6f9017798712c04a8f838cd66a85103a15:
| Sandbox | Source |
|---|---|
| example | Configuration |
Thanks for this. It helps. My time has been sparse lately, but I am looking into this issue.