Jest tests are failing to load model


I’m trying to set up some unit tests for my project.

I’m loading a scene from blender and wanted to make a test to check:

if the model is loading correctly
2 does it have all meshes with proper ids that I need.

But I can’t make it load properly with jest.

I looked at Babylon test folder and got 2 questions:

  1. is this:

.load(function() {
// Force apply promise polyfill for consistent behavior between chrome headless, IE11, and other browsers.

somehow transferable to jest?? And is this polyfill needed for tests and that is my problem.

  1. BABYLONDEVTOOLS - what is this ??

  2. Do I need to set up my own server which will serve static assets to load?

  3. I did step 3 already and I’m stuck cause the file exists in the browser but SceneLoader.Append keep failing to find it with error:

Unable to load from 3d/model.babylon: Error in onSuccess callback

Are you trying from your own project or from inside the Babylon repo ?

If not from within Babylon you should not consider using the BABYLONDEVTOOLS. They are only internal tools we use during the development of Babylon itself. They are not meant to be transferable over another repo as they are hevily coupled to our entire structure and dev tooling.


  1. Nope but it actually fill in the same kind of need.
  2. As discussed helps us working with unbundled packages locally to speed up our iteration time.
  3. You will probably need a server for assets or some special file loader like in Webpack
  4. It means there is an error in the callback so you should debug this part to understand where.


Thanks for quick replay:\

  1. OK
  2. OK
  3. With web pack the assets loaded with model are loosing paths like textures in subfolders of model. I already tried this.
  4. It works in the code but it does not work in the jest only. I do not know should I think about my server is wrong, or the path is wrong (the path is ok cause I actually tested this and its working fine), or I do not know what that this is not giving me any additional information what happened.

I will debug this and return to it if needed thanks.

Any other suggestions about doing your own testing to Babylon that you can share ??