Skip to content

Conversation

rkeshwani
Copy link

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-fetch is added as a dev dependency to provide fetch, Request, and Response objects.
  • These are polyfilled globally in the Jest setup file for all tests to use.
  • The test mocks the fetch call to return a minimal, valid GLB file as an ArrayBuffer.

This approach was chosen after discovering that the native test environment does not support the features required for a full native integration test.

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-fetch` is added as a dev dependency to provide `fetch`, `Request`, and `Response` objects.
- These are polyfilled globally in the Jest setup file for all tests to use.
- The test mocks the `fetch` call to return a minimal, valid GLB file as an `ArrayBuffer`.

This approach was chosen after discovering that the native test environment does not support the features required for a full native integration test.
Copy link

codesandbox-ci bot commented Aug 8, 2025

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 d6f25b6:

Sandbox Source
example Configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant