Unit test for new Mesh

I’m trying to do unit test, I have
In my test, when I run the test, it shows error “Cannot read property ‘getUniqueId’ of null”
the error is on this line let mesh1 = new Mesh(‘mesh1’);

Any idea what I did wrong? Thanks!

I’m pretty sure that error is because you haven’t created a scene, which is required to be done before creating a mesh. This playground for example just creates a scene and a mesh without error. But if I comment out the line to create the scene like in this playground then it produces the error.

2 Likes

I see, I get the same problem before, but I thought scene is not required to new a mesh, thank you, I will try that out, that really helpful, thank you!

2 Likes