Testing Babylon projects

Considering the fact that Babylon rendering is visual in nature on a canvas, asserting that the right results is achieved with unit testing may be a bit problematic.

It is easy enough to mock out the babylon classes for unit tests to ensure that the data structure is correct but is there a way where you can do proximate render testing?
Doing pixel by pixel testing is just begging to be brittle, but is there from a industry perspective a standard around this problem space?

Yeah visual testing is never something very “obvious”, but we indeed do pixel testing for them, false positives happen sometimes but it works fine in general :smiley: You can take a look at how our testing is structured here: Babylon.js/packages/tools/tests at master · BabylonJS/Babylon.js (github.com) (especially the visualization tests)

1 Like

That is a very good suggestion, thank you very much, will have a look.