iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.1k stars 297 forks source link

[Improvment] Unit Tests - mocking and implementation of true unit tests #2291

Open ftoromanoff opened 6 months ago

ftoromanoff commented 6 months ago

A first PR: #2183 aims at mocking the Fetch in the unit tests using the package sinon. It was done in the optics to get the units test independent to the network and to know when a test is failing because of it.

But to go further, and implement 'better' units test we should use sinon (or something else) to mock everything that might be use to test a specific fonctionality. For instance to test dataSourceProvider we should mock the layer that are needed instead of mocking the fethc that weill be use to instanciate that same layer.