How to create tests for a custom Loader

Hi all,

First post, new to THREE, and diving right in here!

I’m trying to unit test a custom loader I have, and can’t figure out how to do it. I see plenty of examples three has for creating custom loaders, but none of them have unit tests (unless I’m not understanding their TODO stubs).

Is it possible to unit test (for CI) when using the FileLoader? I have the correct path (confirmed with fs.existsSync), but FileLoader never gives a response, progress, or error from a node environment.

Also, I don’t see a question tag for tests :slight_smile:

There is actually a small unit test setup for GLTFLoader: three.js/GLTFLoader.tests.js at 1841a615d856846aaa78b3afe4af2c7f4819d944 · mrdoob/three.js · GitHub



Your insanely fast response times make me wonder if you’re human. :slight_smile:


Ok great, it confirms how I was leaning. It doesn’t test the loading, only the parsing, which is fine by me. Will do that, thanks!