Hi
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:
- is this:
(BABYLONDEVTOOLS).Loader
.useDist()
.testMode()
.load(function() {
// Force apply promise polyfill for consistent behavior between chrome headless, IE11, and other browsers.
BABYLON.PromisePolyfill.Apply(true);
done();
});
somehow transferable to jest?? And is this polyfill needed for tests and that is my problem.
-
BABYLONDEVTOOLS - what is this ??
-
Do I need to set up my own server which will serve static assets to load?
-
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.
So:
- Nope but it actually fill in the same kind of need.
- As discussed helps us working with unbundled packages locally to speed up our iteration time.
- You will probably need a server for assets or some special file loader like in Webpack
- It means there is an error in the callback so you should debug this part to understand where.
Hi
Thanks for quick replay:\
- OK
- OK
- With web pack the assets loaded with model are loosing paths like textures in subfolders of model. I already tried this.
- 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 ??
Regards