You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some specs use the Jasmine toBeCloseTo function to check whether an actual value is close to an expected value. The function receives a precision parameter that is documented as "The number of decimal points to check". This is used internally, roughly: as an exponent of 10, to basically "shift" the values into the right range.
Some of the specs seem to assume that this precision parameter is supposed to be an "epsilon". One example (just a random search result) is here, where CesiumMath.EPSILON10 is passed in as the 'precision'. This essentially acts like an epsilon of 0.5 (!). Specifically, a test like
Other places seem to use the precision parameter properly (e.g. with values like 2 or 3).
The Testing Guide recommends to use the (Cesium custom) matcher toEqualEpsilon. I think that in many cases where someone passed in some epsilon to toBeCloseTo, this call can just be replaced with toEqualEpsilon. But where exactly the wrong assumption about that parameter was made has to be reviewed.
The text was updated successfully, but these errors were encountered:
Some specs use the Jasmine
toBeCloseTo
function to check whether an actual value is close to an expected value. The function receives aprecision
parameter that is documented as "The number of decimal points to check". This is used internally, roughly: as an exponent of 10, to basically "shift" the values into the right range.Some of the specs seem to assume that this
precision
parameter is supposed to be an "epsilon". One example (just a random search result) is here, whereCesiumMath.EPSILON10
is passed in as the 'precision'. This essentially acts like an epsilon of 0.5 (!). Specifically, a test likewill pass, which is certainly not expected.
Other places seem to use the
precision
parameter properly (e.g. with values like 2 or 3).The Testing Guide recommends to use the (Cesium custom) matcher
toEqualEpsilon
. I think that in many cases where someone passed in some epsilon totoBeCloseTo
, this call can just be replaced withtoEqualEpsilon
. But where exactly the wrong assumption about that parameter was made has to be reviewed.The text was updated successfully, but these errors were encountered: